Content Egg Pro Plugin
Pricing
  • Content Egg WP Plugin
  • Getting started
    • Installation
    • Upgrade Free to Pro
    • Automatic updates
  • Modules
    • General information
    • Affiliate modules
      • Aliexpress module
      • Amazon module
      • Amazon No API module
      • Avantlink Products module
      • Awin module
      • Bestbuy module
      • Bolcom module
      • CityAds Products module
      • CJ Products module
      • Daisycon module
      • Ebay module
      • Envato module
      • Flipkart module
      • GdeSlon module
      • Impactradius module
      • Kelkoo module
      • Kieskeurignl module
      • Rakuten Linkshare module
      • Linkwise module
      • Lomadee Products module
      • Offer module
      • Optimisemedia module
      • Shareasale module
      • Shopee module
      • Tradedoubler Products module
      • Tradetracker Products module
      • Trovaprezzi
      • Udemy module (deprecated)
      • Sovrn (Viglink) module
      • Walmart module
      • Webgains module
    • Coupon modules
      • Admitad Coupons module
      • CJ Links module
      • Coupon module
      • Lomadee Coupons module
      • Skimlinks Coupons module
      • Tradedoubler Coupons module
      • Tradetracker Coupons module
    • Content modules
      • Bing Images module
      • Flickr module
      • Freebase module
      • Google Books module
      • Google Images module
      • Pixabay module
      • Qwant Images module
      • Related Keywords module
      • RSS Fetcher module
      • Twitter module
      • Youtube module
    • Feed modules
      • General information
      • Field mapping
      • Mass import
      • Price comparison based on feeds
      • Troubleshooting
    • Module cloning
    • Deprecated modules
    • My network isn't listed
    • Affiliate Egg integration
    • Deeplink settings
  • Set Up Products
    • How to add products
    • Price comparison websites
    • Autoblogging
    • Fill tool
    • Products page
    • How to add badge icons
  • Frontend
    • How content is displayed
    • 🆕Gutenberg blocks
    • 👉Shortcode parameters
    • Product groups/variations
    • Product sorting
    • Featured images
    • Frontend Search
    • Translation
    • Greenshift templates
  • Updating products
    • Price update
    • Product list update
    • Why prices don't update
    • Out-of-stock products
    • Price history
    • Price alert
    • Price movers
  • 🪄AI
    • Activating AI features
    • AI content generation
    • Smart groups
    • OpenAI API
    • Claude API
    • OpenRouter API
    • Custom prompts
  • WooCommerce Integration
    • General information
    • Product synchronization
    • Attributes synchronization
    • WooCommerce and autoblogging
  • Integrations
    • Affiliate Egg Integration
    • Cashback Tracker Integration
    • External Importer integration
    • WooCommerce Integration
  • Custom Templates
    • Customizing templates with CSS
    • How to install a custom template
    • 🪄ChatGTP Template Creator
    • How to create a custom template
  • Customization
    • Localization
    • For developers
    • Useful code snippets
    • REST API
    • Compatibility with themes
  • FAQ
    • How to add price comparison blocks to WooCommerce
    • How to add custom logos for merchants
    • How to import from CSV data feeds
    • How to change the date format or the date is not being displayed
    • Is Content Egg GDPR Compliant?
    • How to add offer count as a custom field
    • How to add products programmatically
  • Troubleshooting
    • Small font size in product blocks
    • Nothing found while search
Powered by GitBook
On this page
  • Custom templates
  • Front search customization
  • REST API
  • Access to data
  • Available filters
  1. Customization

For developers

PreviousLocalizationNextUseful code snippets

Last updated 10 months ago

Custom templates

You can add to your theme unique templates for the Content Egg plugin.

Front search customization

REST API

Access to data

add_action('content_egg_save_data', 'my_function', 13, 4);

Hook is called every time after saving/updating data of the Content Egg plugin.

Parameters:

$data - (array) Data array.

$module_id - (string) Module ID.

$post_id - (int) Post ID.

$is_last_iteration - (bool) Is this the last iteration or will there be other modules that need to save the data right now?

add_action('cegg_autoblog_post_create', 'my_function', 10, 1);

Hook is called every time after creating the post by autoblog

Parameters:

$post_id - (int) Post ID.

The Content Egg data is stored in standard Custom fields of Wordpress. In your theme or plugin you can get an access to the raw data of each module:

get_post_meta($post_id, '_cegg_data_'. $module_id, true);

The recommended way to get the Content Egg data, after processing for display on the site:

\ContentEgg\application\components\ContentManager::getViewData($module_id, $post_id);

Available filters

Templates for modules might be stored in theme directory. Thus you can create theme with the special number of Content Egg templates. And, maybe, you will want to disable some or all standard Content Egg templates. Use the filter to do this:

add_filter('content_egg_module_templates', 'my_filter_function');

The first parameter will be array of templates list, the second – module title.

For block templates:

add_filter('content_egg_block_templates', 'my_filter_function');

Also you can disable some modules:

add_filter('content_egg_modules', 'my_filter_function');

Use these features carefully, explain to the user why some standard plugin features are disabled.

If you are the author of a theme or a plugin, and you have any questions or proposes, please apply to our support.

Frontend Search
REST API