View Categories

Popup Notices: Developer Hooks, Filters and Shortcodes Reference

Popups for WooCommerce: Add to Cart, Checkout & More exposes filters and actions so you can change the modal markup, control when the plugin loads, add restrictive-loading conditionals, and adjust the notices it targets, all in code. Every hook below is prefixed ttt_pnwc_ and was verified against the plugin source for v1.5.4.

Template and markup filters #

Filter Filtered value Notes
ttt_pnwc_modal_template The full modal HTML string. Must keep the {header_content} and {footer_content} placeholders and the ttt-pnwc-content container.
ttt_pnwc_header_content Header HTML (default: the close button). Replaces {header_content}.
ttt_pnwc_footer_content Footer HTML (default: empty). Replaces {footer_content}. Pro uses it for the internal close button.
ttt_pnwc_notice_selector The CSS selector for a hidden native notice. Second argument is the context: error_wrapper, success, or info. Defaults are .woocommerce-error, .woocommerce-message, .woocommerce-info.

Loading and localization filters #

Filter Filtered value Notes
ttt_pnwc_is_allowed_to_load Boolean: should the plugin load on this request. Return false to stop scripts loading. This is how Restrictive Loading works.
ttt_pnwc_current_page_allowed Boolean for the page check. Second argument is the allowed pages array.
ttt_pnwc_conditionals_options Associative array of conditional callbacks for Restrictive Loading. Key is a callable name, value is the label. Pro adds is_cart, is_checkout, is_shop, and others.
ttt_pnwc_localize_script The ttt_pnwc_info data array passed to the frontend script. Holds notice types, AJAX, cookie, audio, auto-close, and ignored-message data.
ttt_pnwc_admin_localize_script The admin script data array. Used on the settings and Customizer screens.
ttt_pnwc_frontend_js_modules_required / ttt_pnwc_admin_js_modules_required Array of JS module names to load. Advanced; used to request optional bundled modules.

Settings filters #

Filter Filtered value
ttt_pnwc_settings_general The General section settings array.
ttt_pnwc_settings_compatibility The Compatibility section settings array.
ttt_pnwc_settings_messages The Messages section settings array.
woocommerce_get_sections_ttt-pnwc The array of settings sub-sections (tab id ttt-pnwc).
ttt_pnwc_license_data Internal free/premium data used to gate fields. Do not rely on it in third-party code.

Action #

pnwc_autoloader fires with the autoloader instance so add-on code can register a namespace: add_action( 'pnwc_autoloader', function( $autoloader ) { $autoloader->add_namespace( 'My\\Namespace', $path ); } );

Shortcodes (Pro) #

Shortcode Attributes Purpose
[ttt_pnwc_get_message] filter Returns the current text of the named WooCommerce message filter.
[ttt_pnwc_product_image] product_id, image_size (default woocommerce_gallery_thumbnail) Outputs a product’s image.

Example: change the hidden success-notice selector #

add_filter( 'ttt_pnwc_notice_selector', function( $selector, $context ) {
    if ( 'success' === $context ) {
        $selector = '.woocommerce-message, .my-theme-success';
    }
    return $selector;
}, 10, 2 );

Need a hand? #

Our team answers developer questions on the Popup Notices support forum.