Skip to content

Commit

Permalink
Merge pull request #3122 from 10up/burhan/fix-warning-on-taxonomy-page
Browse files Browse the repository at this point in the history
Fix: Undefined array key on taxonomy page
  • Loading branch information
felipeelia authored Nov 8, 2022
2 parents ce6f373 + b22319a commit e34c98b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/classes/Indexable/Post/SyncManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ protected function is_tax_max_count_bigger_than_items_per_cycle( \WP_Taxonomy $t
]
);

if ( ! is_array( $max_count ) || ! $max_count[0] instanceof \WP_Term || ! is_integer( $max_count[0]->count ) ) {
if ( ! is_array( $max_count ) || ! count( $max_count ) || ! $max_count[0] instanceof \WP_Term || ! is_integer( $max_count[0]->count ) ) {
set_transient( $transient_name, 0, HOUR_IN_SECONDS );
return false;
}
Expand Down

0 comments on commit e34c98b

Please sign in to comment.