Defining array before attempting to append to it
This commit is contained in:
parent
fb290ebbaa
commit
d06854a0b4
|
@ -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' ) );
|
||||
|
|
Loading…
Reference in New Issue