How Can We Help?

You are here:
< Back

January 26th, 2023

Version 1.0

HOOKS

Welcome to the Developer Documentation for UpsellMaster!

Get ready to unleash the potential of UpsellMaster Hooks for seamless customization.

Explore the variety of UpsellMaster Hooks designed with developers in mind.

ACTIONS

Find the latest UpsellMaster action hooks in the list below.

/**
 * Fires when saving a specific Setup Wizard step.
 *
 * @param array $data The step-related data.
 */
do_action( "psupsellmaster_admin_setup_wizard_save_{$step}", $data );

/**
 * Fires when saving a Setup Wizard step.
 *
 * @param string $step The step.
 * @param array $data The step-related data.
 */
do_action( 'psupsellmaster_admin_setup_wizard_save', $step, $data );

/**
 * Fires at the beginning when rendering the campaign templates.
 */
do_action( 'psupsellmaster_campaign_templates_begin' );

/**
 * Fires before the campaign templates markup.
 */
do_action( 'psupsellmaster_campaign_templates_before' );

/**
 * Fires after the campaign templates markup.
 */
do_action( 'psupsellmaster_campaign_templates_after' );

/**
 * Fires at the end when rendering the campaign templates.
 */
do_action( 'psupsellmaster_campaign_templates_end' );

/**
 * Fires before rendering the settings.
 */
do_action( 'psupsellmaster_before_settings' );

/**
 * Fires after rendering the settings.
 */
do_action( 'psupsellmaster_after_settings' );

/**
 * Fires before the Clear Results modal content markup.
 */
do_action('psupsellmaster_modal_action_clear_results_before');

/**
 * Fires after the Clear Results modal content markup.
 */
do_action( 'psupsellmaster_modal_action_clear_results_after' );

/**
 * Fires when rendering the Upsell-related fields in the product meta box.
 *
 * @param WP_Post $post The product post object.
 */
do_action( 'psupsellmaster_product_meta_box_upsells_fields', $post );

/**
 * Fires when rendering the Campaign-related fields in the product meta box.
 *
 * @param WP_Post $post The product object.
 */
do_action( 'psupsellmaster_product_meta_box_campaigns_fields', $post );

/**
 * Fires when saving data in the Upsells product meta box.
 *
 * @param int $post_id The ID of the product.
 */
do_action( 'psupsellmaster_save_meta_box_upsells', $post_id );

/**
 * Fires when rendering the inline fields in the products list page.
 *
 * @param array $args The arguments.
 */
do_action( 'psupsellmaster_products_inline_edit_fields', $args );

/**
 * Fires when saving the inline data in the products list page.
 *
 * @param array $args The arguments.
 */
do_action( 'psupsellmaster_products_save_inline_edit', $args );

/**
 * Fires when registering the admin scripts.
 */
do_action( 'psupsellmaster_admin_register_scripts' );

/**
 * Fires when registering the admin styles.
 */
do_action( 'psupsellmaster_admin_register_styles' );

/**
 * Fires when enqueuing an admin script.
 *
 * @param string $script_key The script key.
 */
do_action( 'psupsellmaster_admin_enqueue_script', $script_key );

/**
 * Fires when enqueuing an admin script.
 *
 * @param string $style_key The style key.
 */
do_action( 'psupsellmaster_admin_enqueue_style', $style_key );

/**
 * Fires when enqueuing the admin scripts and styles.
 */
do_action( 'psupsellmaster_admin_enqueue_scripts_styles' );

/**
 * Fires when running downgrade actions.
 */
do_action( 'psupsellmaster_type_init_downgrade' );

/**
 * Fires when running upgrade actions.
 */
do_action( 'psupsellmaster_type_init_upgrade' );

/**
 * Fires when defining the constants.
 */
do_action( 'psupsellmaster_define_constants' );

/**
 * Fires before including most files.
 */
do_action( 'psupsellmaster_includes_before' );

/**
 * Fires after including most files.
 */
do_action( 'psupsellmaster_includes_after' );

/**
 * Fires when adding some admin hooks.
 */
do_action( 'psupsellmaster_hooks_admin' );

/**
 * Fires before purging caches.
 */
do_action( 'psupsellmaster_campaigns_purge_caches_before' );

/**
 * Fires after purging caches.
 */
do_action( 'psupsellmaster_campaigns_purge_caches_after' );

/**
 * Fires at the beginning when rendering the exit intent popup.
 */
do_action( 'psupsellmaster_popup_exit_intent_begin' );

/**
 * Fires at the end when rendering the exit intent popup.
 */
do_action( 'psupsellmaster_popup_exit_intent_end' );

/**
 * Fires at the beginning when rendering the add-to-cart popup.
 *
 * @param string $context The context.
 */
do_action( 'psupsellmaster_popup_add_to_cart_begin', $context );

/**
 * Fires before the products markup when rendering the add-to-cart popup.
 *
 * @param string $context The context.
 */
do_action( 'psupsellmaster_popup_add_to_cart_before_products', $context );

/**
 * Fires at the end when rendering the add-to-cart popup.
 *
 * @param string $context The context.
 */
do_action( 'psupsellmaster_popup_add_to_cart_end', $context );

/**
 * Fires when registering the scripts.
 */
do_action( 'psupsellmaster_register_scripts' );

/**
 * Fires when registering the styles.
 */
do_action( 'psupsellmaster_register_styles' );

/**
 * Fires when enqueuing a script.
 *
 * @param string $script_key The script key.
 */
do_action( 'psupsellmaster_enqueue_script', $script_key );

/**
 * Fires when enqueuing a style.
 *
 * @param string $style_key The style key.
 */
do_action( 'psupsellmaster_enqueue_style', $style_key );

/**
 * Fires when enqueuing the scripts and styles.
 */
do_action( 'psupsellmaster_enqueue_scripts_styles' );

/**
 * Fires when enqueuing the block assets.
 */
do_action( 'psupsellmaster_enqueue_block_assets' );

/**
 * Fires when enqueuing the block editor assets.
 */
do_action( 'psupsellmaster_enqueue_block_editor_assets' );

/**
 * Fires before inserting tracking results.
 */
do_action( 'psupsellmaster_tracking_insert_results_before' );

/**
 * Fires after inserting tracking results.
 */
do_action( 'psupsellmaster_tracking_insert_results_after' );

FILTERS

Find the latest UpsellMaster filter hooks in the list below.

/**
 * Filters the core campaign templates.
 *
 * @param array $templates The templates.
 */
apply_filters( 'psupsellmaster_campaigns_get_core_templates', $templates );

/**
 * Filters the stored campaign templates.
 *
 * @param array $templates The templates.
 */
apply_filters( 'psupsellmaster_campaigns_get_stored_templates', $templates );

/**
 * Filters the campaign templates.
 *
 * @param array $templates The templates.
 */
apply_filters( 'psupsellmaster_campaigns_get_templates', $templates );

/**
 * Filters the modal close icon markup.
 *
 * @param string $icon The icon.
 */
apply_filters( 'psupsellmaster_modal_close_icon_element', psupsellmaster_render_svg_icon( 'modal-close' ) );

/**
 * Filters the core campaign template image paths.
 *
 * @param array $paths The paths.
 */
apply_filters( 'psupsellmaster_campaigns_get_core_template_image_paths', $paths );

/**
 * Filters the admin menus.
 *
 * @param array $menus The menus.
 */
apply_filters( 'psupsellmaster_admin_menus', $menus );

/**
 * Filters the admin submenus.
 *
 * @param array $menus The submenus.
 */
apply_filters( 'psupsellmaster_admin_submenus', $submenus );

/**
 * Filters the admin page path.
 *
 * @param string $path The page path.
 * @param string $key The page key.
 */
apply_filters( 'psupsellmaster_admin_render_page', $path, $key );

/**
 * Filters the arguments when saving the product quick edit data.
 *
 * @param array $args The arguments.
 */
apply_filters( 'psupsellmaster_products_save_quick_edit_args', $args );

/**
 * Filters the arguments when saving the product bulk edit data.
 *
 * @param array $args The arguments.
 */
apply_filters( 'psupsellmaster_products_save_bulk_edit_args', $args );

/**
 * Filters the admin settings tabs.
 *
 * @param array $tabs The tabs.
 */
apply_filters( 'psupsellmaster_admin_settings_tabs', $tabs );

/**
 * Filters whether the current page is an admin page.
 *
 * @param boolean $found Whether it is an admin page.
 * @param string $page The page key.
 * @param string $view The view key.
 * @param string $passed_page The passed page key.
 * @param string $passed_view The passed view key.
 */
apply_filters( 'psupsellmaster_admin_is_page', $found, $page, $view, $passed_page, $passed_view );

/**
 * Filters the Lite admin settings tabs.
 *
 * @param array $tabs The tabs.
 */
apply_filters( 'psupsellmaster_lite_admin_settings_tabs', $tabs );

/**
 * Filters the Lite plugin action links.
 *
 * @param array $actions The actions.
 */
apply_filters( 'psupsellmaster_lite_plugin_action_links', $actions );

/**
 * Filters the PRO core campaign templates.
 *
 * @param array $templates The templates.
 */
apply_filters( 'psupsellmaster_pro_campaigns_get_core_templates', $templates );

/**
 * Filters the PRO core campaign template image paths.
 *
 * @param array $paths The paths.
 */
apply_filters( 'psupsellmaster_pro_campaigns_get_core_template_image_paths', $paths );

/**
 * Filters the PRO admin submenus.
 *
 * @param array $menus The submenus.
 */
apply_filters( 'psupsellmaster_pro_admin_submenus', $submenus );

/**
 * Filters the PRO admin page path.
 *
 * @param string $path The page path.
 * @param string $key The page key.
 */
apply_filters( 'psupsellmaster_pro_admin_render_page', $path, $key );

/**
 * Filters whether the current page is a PRO admin page.
 *
 * @param boolean $found Whether it is a PRO admin page.
 * @param string $page The page key.
 * @param string $view The view key.
 * @param string $passed_page The passed page key.
 * @param string $passed_view The passed view key.
 */
apply_filters( 'psupsellmaster_pro_admin_is_page', $found, $page, $view, $passed_page, $passed_view );

/**
 * Filters the PRO arguments when saving the product quick edit data.
 *
 * @param array $args The arguments.
 */
apply_filters( 'psupsellmaster_pro_products_save_quick_edit_args', $args );

/**
 * Filters the PRO arguments when saving the product bulk edit data.
 *
 * @param array $args The arguments.
 */
apply_filters( 'psupsellmaster_pro_products_save_bulk_edit_args', $args );

/**
 * Filters the PRO admin settings tabs.
 *
 * @param array $tabs The tabs.
 */
apply_filters( 'psupsellmaster_pro_admin_settings_tabs', $tabs );

/**
 * Filters the PRO campaign-related locations.
 *
 * @param array $locations The locations.
 */
apply_filters( 'psupsellmaster_pro_campaigns_locations', $locations );

/**
 * Filters the PRO settings definitions.
 *
 * @param array $definitions The definitions.
 */
apply_filters( 'psupsellmaster_pro_settings_definitions', $definitions );

/**
 * Filters the PRO maximum number of priorities.
 *
 * @param int $max The maximum number of priorities.
 */
apply_filters( 'psupsellmaster_pro_settings_max_priorities', $max );


/**
 * Filters the PRO maximum number of upsells.
 *
 * @param int $max The maximum number of upsells.
 */
apply_filters( 'psupsellmaster_pro_settings_max_upsells', $max );

/**
 * Filters the PRO priorities.
 *
 * @param array $priorities The priorities.
 */
apply_filters( 'psupsellmaster_pro_priorities', $priorities );

/**
 * Filters the PRO priority descriptions.
 *
 * @param array $descriptions The descriptions.
 */
apply_filters( 'psupsellmaster_pro_priority_descriptions', $descriptions );

/**
 * Filters whether the PRO feature is active.
 *
 * @param boolean $is_active Whether the feature is active.
 */
apply_filters( 'psupsellmaster_pro_feature_is_active', $is_active, $key );

/**
 * Filters the settings definitions.
 *
 * @param array $definitions The definitions.
 */
apply_filters( 'psupsellmaster_settings_definitions', $definitions );

/**
 * Filters the value when getting a setting.
 *
 * @param mixed $value The value.
 * @param string $field The field.
 * @param array $data The data.
 */
apply_filters( 'psupsellmaster_settings_get_value', $value, $field, self::$data );

/**
 * Filters the settings data when updating the settings.
 *
 * @param array $data The data.
 */
apply_filters( 'psupsellmaster_settings_update', self::$data );

/**
 * Filters the plugin action links.
 *
 * @param array $actions The actions.
 */
apply_filters( 'psupsellmaster_plugin_action_links', $actions );

/**
 * Filters the campaign-related locations.
 *
 * @param array $locations The locations.
 */
apply_filters( 'psupsellmaster_campaigns_get_locations', $locations );

/**
 * Filters the campaign-related excluded products.
 *
 * @param array $products The products.
 */
apply_filters( 'psupsellmaster_campaigns_excluded_products', array() );

/**
 * Filters whether multiple coupons is allowed (WooCommerce).
 *
 * @param boolean $allowed Whether multiple coupons is allowed.
 */
apply_filters( 'psupsellmaster_woo_is_multiple_coupons_allowed', $allowed );

/**
 * Filters whether multiple coupons is allowed (Easy Digital Downloads).
 *
 * @param boolean $allowed Whether multiple coupons is allowed.
 */
apply_filters( 'psupsellmaster_edd_is_multiple_coupons_allowed', $allowed );

/**
 * Filters whether multiple coupons is allowed.
 *
 * @param boolean $allowed Whether multiple coupons is allowed.
 */
apply_filters( 'psupsellmaster_is_multiple_coupons_allowed', $allowed );

/**
 * Filters the campaign-related excluded products of a coupon (Easy Digital Downloads).
 *
 * @param array $products The products.
 * @param int $coupon_id The coupon ID.
 */
apply_filters( 'psupsellmaster_edd_campaigns_coupon_excluded_products', $products, $coupon_id );

/**
 * Filters the campaign-related excluded products of a coupon (WooCommerce).
 *
 * @param array $products The products.
 * @param int $coupon_id The coupon ID.
 */
apply_filters( 'psupsellmaster_woo_campaigns_coupon_excluded_products', $products, $coupon_id );

/**
 * Filters the campaign-related excluded products of a coupon.
 *
 * @param array $products The products.
 * @param int $coupon_id The coupon ID.
 */
apply_filters( 'psupsellmaster_campaigns_coupon_excluded_products', $products, $coupon_id );

/**
 * Filters the image size when rendering the add-to-cart popup.
 *
 * @param string $size The image size.
 */
apply_filters( 'psupsellmaster_popup_add_to_cart_image_size', 'medium' );

/**
 * Filters the headline text when rendering the add-to-cart popup.
 *
 * @param string $headline The headline text.
 */
apply_filters( 'psupsellmaster_popup_add_to_cart_headline', $headline );

/**
 * Filters the tagline text when rendering the add-to-cart popup.
 *
 * @param string $tagline The tagline text.
 */
apply_filters( 'psupsellmaster_popup_add_to_cart_tagline', $tagline );

/**
 * Filters the checkout button text when rendering the add-to-cart popup.
 *
 * @param string $button_checkout The button text.
 */
apply_filters( 'psupsellmaster_popup_add_to_cart_button_checkout', $button_checkout );

/**
 * Filters the maximum number of priorities.
 *
 * @param int $max The maximum number of priorities.
 */
apply_filters( 'psupsellmaster_settings_max_priorities', $max );

/**
 * Filters the maximum number of upsells.
 *
 * @param int $max The maximum number of upsells.
 */
apply_filters( 'psupsellmaster_settings_max_upsells', $max );

/**
 * Filters the item product URL.
 *
 * @param boolean $is_active Whether the feature is active.
 * @param string $key The feature key.
 */
apply_filters( 'psupsellmaster_feature_is_active', $is_active, $key );

/**
 * Filters the item product URL.
 *
 * @param string $permalink The permalink.
 * @param int $product_id The product ID.
 */
apply_filters( 'psupsellmaster_item_product_url', $permalink, $product_id );

/**
 * Filters whether scripts and styles should be enqueued when rendering products.
 *
 * @param boolean $enqueue Whether scripts and styles should be enqueued.
 * @param string $location The location.
 * @param array $atts The attributes.
 * @param array $defaults The defaults.
 */
apply_filters( 'psupsellmaster_render_products_enqueue_scripts_styles', true, $location, $atts, $defaults );

/**
 * Filters the priorities.
 *
 * @param array $priorities The priorities.
 */
apply_filters( 'psupsellmaster_priorities', $priorities );

/**
 * Filters the priority descriptions.
 *
 * @param array $descriptions The descriptions.
 */
apply_filters( 'psupsellmaster_priority_descriptions', $descriptions );

/**
 * Filters the base products ID list.
 *
 * @param array $products The products.
 * @param string $source The source.
 * @param array $args The arguments.
 */
apply_filters( 'psupsellmaster_base_products_id_list', array(), $source, $args );

/**
 * Filters the ignore products ID list.
 *
 * @param array $products The products.
 */
apply_filters( 'psupsellmaster_ignore_products_id_list', array() );

/**
 * Filters the products title.
 *
 * @param string $section_title The section title.
 * @param string $location The location.
 */
apply_filters( 'psupsellmaster_products_title', $section_title, $location );

/**
 * Filters the products CTA.
 *
 * @param string $cta_text The CTA text.
 * @param string $location The location.
 */
apply_filters( 'psupsellmaster_products_cta', $cta_text, $location );

/**
 * Filters the weekdays.
 *
 * @param array $weekdays The weekdays.
 */
apply_filters( 'psupsellmaster_weekdays', $weekdays );

/**
 * Filters the feature limit.
 *
 * @param mixed $limit The limit.
 * @param string $key The feature key.
 */
apply_filters( 'psupsellmaster_feature_limit', $limit, $key );

/**
 * Filters whether the feature limit has been reached.
 *
 * @param boolean $reached Whether the feature limit has been reached.
 * @param string $key The feature key.
 */
apply_filters( 'psupsellmaster_reached_feature_limit', $reached, $key );

/**
 * Filters the feature limit notices.
 *
 * @param string $output The output.
 * @param string $key The feature key.
 */
apply_filters( 'psupsellmaster_feature_limit_notices', $output, $key );