Defining array before attempting to append to it

This commit is contained in:
ahmedofali 2018-03-25 18:28:14 +00:00
parent fb290ebbaa
commit d06854a0b4
1 changed files with 2 additions and 0 deletions

View File

@ -217,6 +217,8 @@ class WC_Cache_Helper {
if ( 'product_cat' === $taxonomy ) {
$ids = is_array( $ids ) ? $ids : array( $ids );
$clear_ids = array();
foreach ( $ids as $id ) {
$clear_ids[] = $id;
$clear_ids = array_merge( $clear_ids, get_ancestors( $id, 'product_cat', 'taxonomy' ) );