Remove_action is not working

Hello there, thanks for the awesome free template :grinning:

I’m trying to remove the function from this hook listed in leto/inc/woocommerce.php line 33:


add_action( ‘woocommerce_after_shop_loop_item_title’, ‘leto_loop_pricing_button’ );

by using this hook inside the the child’s functions.php:

function remove_leto_loop_pricing_button()
{
remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘leto_loop_pricing_button’ );
}
add_action(‘wp_loaded’, ‘remove_leto_loop_pricing_button’);

Please help me, it’s not working, thanks in advance.

Don’t bother. I found the solution. Change the hook for removing the action using template_redirect :

add_action(‘template_redirect’, ‘remove_leto_loop_pricing_button’);

1 Like

Hi,

​Please accept my apologies for the delay in response. I really appreciate your patience.

Glad to know you found the solution and thank you for sharing it here.

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis
aThemes Support