Merge pull request #3696 from BFTrick/product-tabs-clean-input
Making Sure the User Doesn't Submit Garbage to woocommerce_sort_product_tabs Function
This commit is contained in:
commit
d7a68b68f2
|
@ -988,10 +988,17 @@ if ( ! function_exists( 'woocommerce_sort_product_tabs' ) ) {
|
|||
* Sort tabs by priority
|
||||
*
|
||||
* @access public
|
||||
* @param mixed $tabs
|
||||
* @return void
|
||||
*/
|
||||
function woocommerce_sort_product_tabs( $tabs = array() ) {
|
||||
|
||||
// Make sure the $tabs parameter is an array
|
||||
if ( ! is_array( $tabs ) ) {
|
||||
trigger_error( "Function woocommerce_sort_product_tabs() expects an array as the first parameter. Defaulting to empty array." );
|
||||
$tabs = array( );
|
||||
}
|
||||
|
||||
// Re-order tabs by priority
|
||||
if ( ! function_exists( '_sort_priority_callback' ) ) {
|
||||
function _sort_priority_callback( $a, $b ) {
|
||||
|
|
Loading…
Reference in New Issue