Check for existing array before using key. Closes #3807
This commit is contained in:
parent
87d7fce7c3
commit
e035864c8a
|
@ -516,6 +516,9 @@ function woocommerce_change_term_counts( $terms, $taxonomies, $args ) {
|
|||
if ( is_admin() || is_ajax() )
|
||||
return $terms;
|
||||
|
||||
if ( ! isset( $taxonomies[0] ) || ! is_array( $taxonomies[0] ) )
|
||||
return $terms;
|
||||
|
||||
if ( ! in_array( $taxonomies[0], apply_filters( 'woocommerce_change_term_counts', array( 'product_cat', 'product_tag' ) ) ) )
|
||||
return $terms;
|
||||
|
||||
|
|
Loading…
Reference in New Issue