Ticket #2836: 2836.patch
File 2836.patch, 1.9 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
653 653 * @param \WP_Query $wp_query The WordPress Query object. 654 654 */ 655 655 public function pre_get_posts( $wp_query ) { 656 if ( is_admin() || ! $wp_query->is_main_query()) {656 if ( is_admin() ) { 657 657 return; 658 658 } 659 659 … … 720 720 $viewing_own_author_archive = false; 721 721 722 722 // Author Archives need to be created 723 if ( isset( $wp_query->query['author_name'] ) || isset( $wp_query->query['author']) ) {724 $user = isset( $wp_query->query['author_name'] ) ? $wp_query->query['author_name'] : (get_user_by( 'id', $wp_query->query['author'])->user_nicename);723 if ( $wp_query->is_main_query() && ( isset( $wp_query->query['author_name'] ) || isset( $wp_query->query['author'] ) ) ) { 724 $user = isset( $wp_query->query['author_name'] ) ? $wp_query->query['author_name'] : get_user_by( 'id', $wp_query->query['author'] )->user_nicename; 725 725 726 726 $viewing_own_author_archive = is_user_logged_in() && ( current_user_can( 'plugin_review' ) || 0 === strcasecmp( $user, wp_get_current_user()->user_nicename ) ); 727 727 … … 756 756 } 757 757 758 758 // For singular requests, or self-author profile requests allow restricted post_status items to show on the front-end. 759 if ( $ viewing_own_author_archive || (is_user_logged_in() && !empty( $wp_query->query_vars['name'] ) ) ) {759 if ( $wp_query->is_main_query() && ( $viewing_own_author_archive || is_user_logged_in() && !empty( $wp_query->query_vars['name'] ) ) ) { 760 760 761 761 $wp_query->query_vars['post_status'] = array( 'approved', 'publish', 'closed', 'disabled' ); 762 762