Hide Price and Add to Cart for WooCommerce icon
eCommerce & WooCommerce

Hide Price and Add to Cart for WooCommerce hooks reference

Hide Price and Add to Cart for WooCommerce 1.0.5 has 1 actions and 13 filters, read directly from its source code on Nov 18, 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.

functions.phpyour child theme
// Run your own code when Hide Price and Add to Cart for WooCommerce fires an action
add_action( 'wmhp_after_single_add_to_cart_replacement', function( $rule_id, $atc_options, $product ) {
	// Your code runs here.
}, 10, 3 );

// Change a value Hide Price and Add to Cart for WooCommerce is about to use
add_filter( 'b2bmanagers_custom_button_atts', function( $atts, $rule_id ) {
	// Change $atts here.
	return $atts;
}, 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

  • includes/class-wmhp-gf.php line 372
    /**
     * Filter the class and style attributes of the custom link button.
     */
    apply_filters( 'b2bmanagers_custom_button_atts', $atts, $rule_id );
  • includes/class-wmhp-atc-btn.php line 237
    /**
     * Filter the text (or button label) that replaces the Add to Cart button.
     */
    apply_filters( 'b2bmanagers_replace_add_to_cart_text', $replace_text, $rule_id, $product );
  • includes/class-wmhp-price.php line 122
    /**
     * Filter the text that replaces a hidden price.
     */
    apply_filters( 'b2bmanagers_replace_price_text', $replace_text, $rule_id, $product );
  • includes/class-wmhp-atc-btn.php line 169
    /**
     * Fires after the add-to-cart replacement for a rule has been printed (or when
     * the rule uses an option this plugin does not render itself).
     */
    do_action( 'wmhp_after_single_add_to_cart_replacement', $rule_id, $atc_options, $product );
  • includes/class-wmhp-rules.php line 130
    /**
     * Filter the IDs of rules that hide the Add to Cart button. Runs on every call
     * so add-ons can narrow the list for the current visitor.
     */
    apply_filters( 'wmhp_hide_price_get_atc_rules', $this->get_flagged_rules( 'atc_rules', 'wmhp_hide_atc' ) );
  • includes/class-wmhp-rules.php line 113
    /**
     * Filter the IDs of rules that hide the price. Runs on every call so add-ons
     * can narrow the list for the current visitor.
     */
    apply_filters( 'wmhp_hide_price_get_price_rules', $this->get_flagged_rules( 'price_rules', 'wmhp_hide_price' ) );
  • includes/class-wmhp-rules.php line 96
    /**
     * Filter the IDs of all published rules.
     */
    apply_filters( 'wmhp_hide_price_get_rules', $data );
  • includes/class-wmhp-hide-price.php line 123
    /**
     * Filter the arguments used to register the Hide Price Rule post type.
     */
    apply_filters( 'wmhp_hide_price_register_post_type', array( 'labels' => array( 'name' => __( 'Hide Price Rules', 'hide-price-and-add-to-cart-for-woocommerce' ), 'singular_name' => __( 'Hide Price Rule', 'hide-price-and-add-to-cart-for-woocommerce' ), 'all_items' => __( 'Hide Price Rules', 'hide-price-and-add-to-cart-for-woocommerce' ), 'menu_name' => _x( 'Hide Price Rules', 'Admin menu name', 'hide-price-and-add-to-cart-for-woocommerce' ), 'add_n... );
  • includes/class-wmhp-gf.php line 44
    /**
     * Filter the plugin folder holding the default templates.
     */
    apply_filters( 'wmhp_price_get_default_template_path', WMHP_PLUGIN_PATH . 'templates/' );
  • includes/class-wmhp-gf.php line 28
    /**
     * Filter the theme folder (relative to the theme root) searched for template
     * overrides.
     */
    apply_filters( 'wmhp_price_get_template_path', 'woocommerce/wm-hide-price/' );
  • includes/class-wmhp-gf.php line 90
    /**
     * Filter whether hide-price rules run for the current request.
     */
    apply_filters( 'wmhp_should_apply_rules', $apply );
  • includes/class-wmhp-gf.php line 362
    /**
     * Legacy name of the filter below, kept so existing customisations keep
     * working.
     */
    apply_filters( 'woomanagers_custom_button_atts', $atts, $rule_id );
  • includes/class-wmhp-atc-btn.php line 226
    /**
     * Legacy name of the filter below, kept so existing customisations keep
     * working.
     */
    apply_filters( 'woomanagers_replace_add_to_cart_text', $replace_text, $rule_id, $product );
  • includes/class-wmhp-price.php line 111
    /**
     * Legacy name of the filter below, kept so existing customisations keep
     * working.
     */
    apply_filters( 'woomanagers_replace_price_text', $replace_text, $rule_id, $product );

Generated from Hide Price and Add to Cart for WooCommerce'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.

Plugin 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 this

Not 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: