Making WordPress.org


Ignore:
Timestamp:
02/22/2022 03:57:11 AM (3 years ago)
Author:
dd32
Message:

Openverse iframe theme: Set WP::query_vars to avoid a PHP Warning when using the do_parse_request filter.

Follow up to [11591].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-openverse/functions.php

    r11591 r11592  
    7474 * this or querying for posts that definitely do not exist within the WordPress site.
    7575 */
    76 add_filter( 'do_parse_request', '__return_false' );
     76function disable_parse_request( $return, $wp ) {
     77    // Avoid E_WARNING: array_keys() expects parameter 1 to be array, null given in wp-includes/class-wp.php:548
     78    $wp->query_vars = array();
     79
     80    return false;
     81}
     82add_filter( 'do_parse_request', __NAMESPACE__ . '\disable_parse_request', 10, 2 );
    7783
    7884/**
Note: See TracChangeset for help on using the changeset viewer.