Last active
August 19, 2021 09:17
-
-
Save woogists/abb8a37f8c708d712e46ce2d02ffdc43 to your computer and use it in GitHub Desktop.
[Frontend Snippets][Editing product data tabs] Reordering product data tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Reorder product data tabs | |
*/ | |
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 ); | |
function woo_reorder_tabs( $tabs ) { | |
$tabs['reviews']['priority'] = 5; // Reviews first | |
$tabs['description']['priority'] = 10; // Description second | |
$tabs['additional_information']['priority'] = 15; // Additional information third | |
return $tabs; | |
} |
This error happens only if description is empty.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have below error message, I guess It is caused because this code. Is it still valid?
2021/03/10 11:39:31 [error] 77282#77282: *18799929 FastCGI sent in stderr: "PHP message: PHP Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /www/xxxx/public/wp-content/themes/woodmart/woocommerce/single-product/tabs/tabs.php on line 60" while reading response header from upstream, client: 194.29.214.244, server: xxx.com, request: "GET /product/4605// HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7.4-fpm-xxxx.sock:", host: "www.xxx.com", referrer: "https://www.google.com/"