Making WordPress.org


Ignore:
Timestamp:
05/13/2020 05:23:41 AM (7 years ago)
Author:
dd32
Message:

SEO Plugin: Handle taxonomy query requests that don't actually have a taxonomy query attached.

The plugin directory sometimes redirects taxonomy queries to be a post_meta-only query.

Avoids a PHP Warning: mu-plugins/pub/wporg-seo/canonical.php:67 - count(): Parameter must be an array or an object that implements Countable

See #5173.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/canonical.php

    r9861 r9869  
    6565
    6666                $term_queries    = count( $tax_queries );
    67                 $term_query_zero = count( $tax_queries[0]['terms'] );
     67                $term_query_zero = count( $tax_queries[0]['terms'] ?? [] );
    6868                if ( $term_queries > 1 || $term_query_zero > 1 ) {
    6969                        // Multiple terms are being queried for.
Note: See TracChangeset for help on using the changeset viewer.