Skip to content

Instantly share code, notes, and snippets.

@toptools
Created September 19, 2020 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toptools/c12629a60f193e7fc97c7a2553748c0c to your computer and use it in GitHub Desktop.
Save toptools/c12629a60f193e7fc97c7a2553748c0c to your computer and use it in GitHub Desktop.
<?php
// Copy from here to your (child) themes functions.php
function my_custom_product_tabs_order( $tabs ) {
// Double check to make sure the default tabs exist and are not removed at some point.
if ( isset( $tabs['description'] ) ) {
$tabs['description']['priority'] = 30;
}
if ( isset( $tabs['additional_information'] ) ) {
$tabs['additional_information']['priority'] = 20;
}
if ( isset( $tabs['reviews'] ) ) {
$tabs['reviews']['priority'] = 10;
}
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'my_custom_product_tabs_order' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment