Making WordPress.org


Ignore:
Timestamp:
05/30/2019 04:20:10 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Limit the author archive query alteration code to when an Author archive query is detected by WP_Query.

This should solve a case where a singular request with author query vars causes a PHP fatal error.

Fixes #4483.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r8655 r8894  
    795795
    796796        // Author Archives need to be created
    797         if ( $wp_query->is_main_query() && ( isset( $wp_query->query['author_name'] ) || isset( $wp_query->query['author'] ) ) ) {
     797        if ( $wp_query->is_main_query() && $wp_query->is_author() ) {
    798798            $user = isset( $wp_query->query['author_name'] ) ? $wp_query->query['author_name'] : get_user_by( 'id', $wp_query->query['author'] )->user_nicename;
    799799
Note: See TracChangeset for help on using the changeset viewer.