Changeset 5532 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
- Timestamp:
- 06/01/2017 05:03:50 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r5500 r5532 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 } … … 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 ) ); … … 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' );
Note: See TracChangeset
for help on using the changeset viewer.