Merge pull request #19520 from ahmedofali/master

Defining array before attempting to append to it
This commit is contained in:
Mike Jolley 2018-03-26 11:15:05 +01:00 committed by GitHub
commit 62e7191ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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' ) );