Skip to content

Instantly share code, notes, and snippets.

@omurphy27
Created July 20, 2015 17:38
Show Gist options
  • Save omurphy27/d1331a48fc59b5d3cb1f to your computer and use it in GitHub Desktop.
Save omurphy27/d1331a48fc59b5d3cb1f to your computer and use it in GitHub Desktop.
Executing WooCommerce Action Hooks within a Conditional
// the priority (3rd parameter) must be lower than the action that is being removed
add_action('woocommerce_single_product_summary','jwd_remove_title',4);
function jwd_remove_title() {
// the conditional must be inside a function
if (is_single()) {
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title',5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment