Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Forked from ChromeOrange/functions.php
Created August 23, 2012 12:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mikejolley/3436246 to your computer and use it in GitHub Desktop.
Save mikejolley/3436246 to your computer and use it in GitHub Desktop.
Move Tabs Around in WooCommerce
<?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.
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 20 );
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 10 );
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30 );
}
@saas786
Copy link

saas786 commented Feb 13, 2014

not working with v2.1

I digged the code and found only this


/**
 * Product page tabs
 */
add_filter( 'woocommerce_product_tabs', 'woocommerce_default_product_tabs' );
add_filter( 'woocommerce_product_tabs', 'woocommerce_sort_product_tabs', 99 );

and first filter adds tabs and second priorities them, but I am not sure where its adding add_action hooks to these tabs.

which is passed to

single-product/tabs/tabs.php

$tabs = apply_filters('woocommerce_product_tabs', array());

So could you please have a look and let me know if your gist is still valid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment