Skip to content

Instantly share code, notes, and snippets.

@s4nji
Forked from mikejolley/functions.php
Last active December 14, 2015 23:49
Show Gist options
  • Save s4nji/5168566 to your computer and use it in GitHub Desktop.
Save s4nji/5168566 to your computer and use it in GitHub Desktop.
Rehooking should be done using add_action().
<?php
add_action( 'wp' , 'wc_order_tabs' );
function wc_order_tabs() {
// Remove tabs
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 10 );
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 20 );
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30 );
// Re-hook with different priorities. See the final args (10, 20, 30) - thats the order they get rendered.
add_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 20 );
add_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 10 );
add_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment