Check for existing array before using key. Closes #3807

This commit is contained in:
Coen Jacobs 2013-09-20 15:51:06 +02:00
parent 87d7fce7c3
commit e035864c8a
1 changed files with 3 additions and 0 deletions

View File

@ -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;