For developers
Custom templates
You can add to your theme unique templates for the Content Egg plugin.
How to create a custom templateFront search customization
Frontend SearchREST API
REST APIAccessing and Modifying Data with Hooks
The Content Egg plugin provides several WordPress hooks to allow developers to interact with the data lifecycle. Below is a detailed reference for working with Content Egg data and customizing its behavior.
content_egg_save_data
add_action('content_egg_save_data', 'my_function', 13, 4);Description: Triggered after saving or updating Content Egg data for a post. Useful for intercepting or modifying saved data per module.
Parameters:
$data(array) — Raw data array saved by the module.$module_id(string) — ID of the Content Egg module (e.g.,amazon,ebay).$post_id(int) — WordPress Post ID.$is_last_iteration(bool) — Whether this is the final module being processed for this post.
cegg_autoblog_post_create
Description: Triggered right after a new post is created by the Auto Blog functionality.
Parameters:
$post_id(int) — ID of the newly created post.
Accessing Stored Module Data
Raw Module Data (Unprocessed)
Content Egg stores module data in standard WordPress custom fields. To retrieve raw data:
Returns an array of module results for the given post and module.
Useful for debugging or low-level manipulation.
Processed View Data (Recommended for Display)
To get data already processed and formatted for display (e.g., as shown in templates):
Returns render-ready data.
Ideal for use in custom themes or shortcodes.
Filters for Customization
Filter: Module Templates
$templates (array) — List of available templates.
$module_title (string) — Human-readable title of the module (e.g., "Amazon", "eBay").
Use this to modify or restrict which templates are available for a module.
Filter: Block Templates
Customize the available block templates across modules.
Filter: Enable/Disable Modules
Dynamically enable or disable Content Egg modules.
Filter: Available Modules per Post
$module_ids (array) — IDs of the modules offered on the post being edited.
$post_id (int) — ID of that post. Available since Content Egg 21.1.0. The classic metabox calls the filter with one argument only, so always give this parameter a default value (
$post_id = 0), otherwise the callback fails there.
Controls which modules can be selected while editing a post. Both the classic metabox and the Products sidebar go through this filter, so a module you remove here is unavailable in either interface.
Nothing is disabled: unlike content_egg_modules, the module keeps its settings, keeps updating its data, and keeps rendering on the frontend. It is only absent from the module lists in the editor.
A ready-made example that limits modules per post type is in Useful code snippets.
Last updated