CampaignBay 1.2.2 has 20 actions and 41 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when CampaignBay fires an action
add_action( 'campaignbay_campaign_save', function( $campaign_id, $campaign ) {
// Your code runs here.
}, 10, 2 );
// Change a value CampaignBay is about to use
add_filter( 'campaignbay_cart_condition_skip_item', function( $value, $cart_item ) {
// Change $value here.
return $value;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Fires after a new campaign is created and all its data is saved. */ do_action( 'campaignbay_campaign_save', $campaign_id, $campaign ); -
/** * Filters whether a cart line is left out of the cart item count used by * cart-level conditions. */ apply_filters( 'campaignbay_cart_condition_skip_item', false, $cart_item ); -
/** * Filters the REST API schema for a single campaign item. */ apply_filters( 'campaignbay_campaign_schema', $this->schema ); -
/** * Filters the WooCommerce product object retrieved by the plugin. */ apply_filters( 'campaignbay_get_product', wc_get_product($product_id), $product_id ); -
/** * Filters the number of days to retain log entries before they are * automatically purged. */ apply_filters( "{CAMPAIGNBAY_TEXT_DOMAIN}_log_retention_days", 7 ); -
/** * Filters the URL of the main admin CSS file. */ apply_filters( 'campaignbay_admin_css', CAMPAIGNBAY_URL . 'build/admin.css' ); -
/** * Filters the URL of the self-contained "legacy" admin JavaScript file. */ apply_filters( 'campaignbay_admin_legacy_script', CAMPAIGNBAY_URL . 'build/admin-legacy.js' ); -
/** * Filters the data passed from PHP to the main admin JavaScript application. */ apply_filters( 'campaignbay_admin_localize', array( 'version' => $version, 'root_id' => CAMPAIGNBAY_PLUGIN_NAME, 'nonce' => wp_create_nonce( 'wp_rest' ), 'store' => CAMPAIGNBAY_PLUGIN_NAME, 'rest_url' => get_rest_url(), 'white_label' => Common::get_instance()->get_white_label(), 'woocommerce_currency_symbol' => $woocommerce_currency_symbol, 'onboarding' => array( 'first_campaign' => $onboarding_first_campaign || false, ), 'wpSettings' => ... ); -
/** * Filters the URL of the main admin JavaScript file. */ apply_filters( 'campaignbay_admin_script', CAMPAIGNBAY_URL . 'build/admin.js' ); -
/** * Fires after all CampaignBay discount calculations are complete and have been * applied to the cart as either coupons or fees. */ do_action( 'campaignbay_after_cart_discount_calculation', $cart ); -
/** * Fires after plugin has calculated all its discount metadata for a single * cart item. */ do_action( 'campaignbay_after_cart_discount_data', $cart_item, $meta ); -
/** * Fires just after the discount logic is processed for a single cart item. */ do_action( 'campaignbay_after_cart_single_discount_calculation', $cart_item, $cart_quantity, $meta, $simple_applied, $discount_breakdown, $cart, $key ); -
/** * Fires after evaluating product against campaign targeting rules. */ do_action( 'campaignbay_after_filter_match', $result, $product, $campaign ); -
/** * Action hook that fires after any discount message is rendered for a product. */ do_action( 'campaignbay_after_product_display_product_discount_message', $product, $meta, $format ); -
/** * Filter whether a non-CampaignBay coupon may stay in the cart although coupon * stacking is off. */ apply_filters( 'campaignbay_allow_coupon_with_discount', false, $code, $coupon, $discount ); -
/** * Fires before a campaign is deleted. */ do_action( 'campaignbay_before_campaign_delete', $campaign_id ); -
/** * Fires before the discount coupons and fees are applied to the cart. */ do_action( 'campaignbay_before_cart_coupon_and_fee_application', $cart, $discount_breakdown ); -
/** * Fires before any of CampaignBay's cart discount calculations begin. */ do_action( 'campaignbay_before_cart_discount_calculation', $cart ); -
/** * Fires before the cart discount calculations begin. */ do_action( 'campaignbay_before_cart_discount_calculation_loop', $cart, $discount_breakdown, $free_products ); -
/** * Fires after the free version has calculated all its discount metadata for a * single cart item. */ do_action( 'campaignbay_before_cart_discount_data', $cart_item ); -
/** * Fires just before the discount logic is processed for a single cart item. */ do_action( 'campaignbay_before_cart_single_discount_calculation', $cart_item, $cart_quantity, $meta, $simple_applied, $discount_breakdown, $cart, $key ); -
/** * Fires before evaluating product against campaign targeting rules. */ do_action( 'campaignbay_before_filter_match', $result, $product, $campaign ); -
/** * Action hook that fires before any discount message is rendered for a * product. */ do_action( 'campaignbay_before_product_display_product_discount_message', $product, $meta ); -
/** * Fires after a campaign is deleted. */ do_action( 'campaignbay_campaign_delete', $campaign_id ); -
/** * Filters whether a campaign type must be saved with at least one tier. */ apply_filters( 'campaignbay_campaign_requires_tiers', in_array( $type, array( 'fixed_price' ), true ), $type ); -
/** * Fires after a campaign's usage count is updated. */ do_action( 'campaignbay_campaign_usage_decremented', $this->id, $this ); -
/** * Fires after a campaign's usage count is updated. */ do_action( 'campaignbay_campaign_usage_incremented', $this->id, $this ); -
/** * Filters the cart total that cart_total conditions are compared against. */ apply_filters( 'campaignbay_cart_total_for_condition', $cart['total'], $cart ); -
/** * Filters the countdown markup. */ apply_filters( 'campaignbay_countdown_html', $html, $campaign, $surface ); -
/** * Filters the campaign chosen for a product's countdown. */ apply_filters( 'campaignbay_countdown_product_campaign', $best, $product ); -
/** * Filters the discount breakdown array for a single cart item after it has * been calculated. */ apply_filters( 'campaignbay_discount_breakdown', $discount_breakdown ?? array(), $cart ); -
/** * Filters the rendered quantity discount cards HTML. */ apply_filters( 'campaignbay_discount_cards_html', $html, $tiers, $base_price ); -
/** * Filters the result of product-campaign matching. */ apply_filters( 'campaignbay_filter_match', $result, $product, $campaign ); -
/** * Filters the HTML output for a sale price display (strikethrough price). */ apply_filters( 'campaignbay_format_sale_price', wc_format_sale_price($price1, $price2), $price1, $price2 ); -
/** * Filters the main validation rules for a campaign. */ apply_filters( 'campaignbay_get_campaign_validation_rules', $rules ); -
/** * Filters the final discount metadata array for a single cart item before it * is returned. */ apply_filters( 'campaignbay_get_cart_discount', $meta, $cart_item ); -
/** * Filters the default conditions validation rules. */ apply_filters( 'campaignbay_get_conditions_validation_rules', $default_rules ); -
/** * Filters the parent ID of a given product. */ apply_filters( 'campaignbay_get_product_parent_id', $parent_id, $product ); -
/** * Filters the settings. */ apply_filters( 'campaignbay_get_settings', Common::get_instance()->get_settings() ); -
/** * Filters the settings validation rules for a campaign. */ apply_filters( 'campaignbay_get_settings_validation_rules', $rules, $type ); -
/** * Filters the tier-specific validation rules for a campaign. */ apply_filters( 'campaignbay_get_tiers_validation_rules', $rules, $type ); -
/** * Filters the need-tier-validation check for a campaign. */ apply_filters( 'campaignbay_need_tier_validation', $result, $type ); -
/** * Filters the discount text used in offer messages. Return an empty string to * skip the campaign. */ apply_filters( 'campaignbay_offer_discount_text', $text, $campaign ); -
/** * Filters the entire settings schema for the plugin. */ apply_filters( 'campaignbay_options_properties', array( 'global_enableAddon' => array( 'type' => 'boolean', 'default' => true, ), 'global_calculate_discount_from' => array( 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'regular_price', ), 'position_to_show_bulk_table' => array( 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'default' => 'woocommerce_after_add_to_cart_form', ), 'position_to_show_discount_b... ); -
/** * Filters the result of a product level rule check. */ apply_filters( 'campaignbay_pass_product_level_condition', $result, $product, $type, $condition ); -
/** * Fires when a product-level campaign type not native to the free version is * being processed. */ do_action( 'campaignbay_product_campaign_discount_calculation', $this->product, $this, $campaign, $original_price, $base_price, $best_price, $applied_campaign, $applied_tier ); -
/** * Fires within the campaign loop, just before the current campaign's price is * compared to the best price. */ do_action( 'campaignbay_product_discount_after_appling', $this->product, $this, $campaign, $original_price, $base_price, $best_price, $applied_campaign, $applied_tier ); -
/** * Fires within the campaign loop, just before the current campaign's price is * compared to the best price. */ do_action( 'campaignbay_product_discount_before_appling', $this->product, $this, $campaign, $original_price, $base_price, $best_price, $applied_campaign, $applied_tier ); -
/** * Filters the final array of calculated discount metadata before it is * attached to the product object. */ apply_filters( 'campaignbay_product_discount_meta', $this->data, $this->product ); -
/** * Filter hook to allow modification of the final discount bogo message string. */ apply_filters_deprecated( 'campaignbay_product_display_product_bogo_message', array( $message, $product, $format ), '1.0.7', 'campaignbay_product_page_bogo_message', 'use campaignbay_product_page_bogo_message instead' ); -
/** * Filter hook to allow modification of the final discount message string. */ apply_filters( 'campaignbay_product_display_product_discount_message', $message, $product, $meta, $format ); -
/** * Filter hook to allow modification of the final discount bogo message string. */ apply_filters( 'campaignbay_product_page_bogo_message', $message, $product, $format, $tier ); -
/** * Filters the quantity limits that apply to a product. */ apply_filters( 'campaignbay_product_quantity_limits', $limits, $product ); -
/** * Filters the REST API schema for the global settings object. */ apply_filters( 'campaignbay_rest_settings_item_schema', $schema ); -
/** * Filters the CampaignBay sale badge HTML. */ apply_filters( 'campaignbay_sale_badge_html', $html, $product, $figures ); -
/** * Filters the entire array of white-label settings for the plugin. */ apply_filters( 'campaignbay_white_label', array( 'plugin_name' => esc_html( 'CampaignBay - WooCommerce Smart Campaigns' ), 'short_name' => esc_html( 'CampaignBay' ), 'menu_label' => esc_html( 'CampaignBay' ), 'custom_icon' => CAMPAIGNBAY_URL . 'assets/img/dash_icon_campaign_bay_light.svg', 'menu_icon' => CAMPAIGNBAY_URL . 'assets/img/dash_icon_campaign_bay_light.svg', 'author_name' => 'WP Anchor Bay', 'author_uri' => 'https://wpanchorb... ); -
/** * Filters the generic white-label plugin name. */ apply_filters( 'campaignbay_white_label_plugin_name', esc_html( 'CampaignBay' ) ); -
/** * Return false to hide the banner, for example on sites that already hold a * Pro licence. */ apply_filters( 'wpab_banner_show', true, $slugs ); -
/** * Let a plugin opt in admin screens whose id does not contain its brand key. */ apply_filters( 'wpab_banner_show_on_screen', false, $screen, $slugs ); -
apply_filters( 'wpab_banner_show_on_dashboard', false ); -
apply_filters( 'wpab_banner_wc_tabs', array_combine( $slugs, $slugs ), $slugs );
Generated from CampaignBay's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: