Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

kadence_before_main_content hook and wc_print_notices_none_woo

Home / Forums / Membership Forums / kadence_before_main_content hook and wc_print_notices_none_woo

This topic is: Not Resolved
[Not Resolved]
September 22, 2021 at 8:37 am

I’ve created something that looks at query vars and auto-applies woocommerce coupon codes. The only problem is, Kadence displays the “Coupon successfully applied” message on whichever page you land on. I’ve seen that it seems to be because of wc_print_notices_none_woo() that is called with the kadence_before_main_content action hook. I can solve it by using remove_all_actions(‘kadence_before_main_content’); but that doesn’t sit well with me because then that hook won’t work well for anything else in the future. I’ve been trying to use remove_action(‘kadence_before_main_content’, ‘wc_print_notices_none_woo’) but it’s not working, even when playing with the priority and trying to hook it further up with a ‘wp_loaded’ or ‘after_setup_theme’ action hook.

  • The forum ‘Membership Forums’ is closed to new topics and replies.