Changeset 11240
- Timestamp:
- 09/15/2021 11:07:04 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/query-modifications.php
r11239 r11240 13 13 return; 14 14 } 15 16 15 // Themes are never via pagename 17 16 if ( !empty( $query->query_vars['pagename'] ) ) { … … 24 23 } 25 24 26 // From now on, always query published themes. 27 $query->query_vars['post_type'] = 'repopackage'; 28 if ( ! isset( $query->query_vars['post_status'] ) ) { 29 $query->query_vars['post_status'] = 'publish'; 30 } 25 // From now on, always query themes. 26 $query->query_vars['post_type'] = 'repopackage'; 31 27 if ( ! isset( $query->query_vars['browse'] ) ) { 32 28 $query->query_vars['browse'] = ''; … … 38 34 } 39 35 40 // Delisted items should be available on singular / author archives.36 // eliminate draft posts from showing up in the directory 41 37 if ( 42 ! empty( $query->query_vars['name'] ) || 43 ! empty( $query->query_vars['author_name'] ) 38 ( 39 ! isset( $query->query_vars['post_status'] ) || 40 'publish' === $query->query_vars['post_status'] 41 ) && 42 ! $query->is_search() 44 43 ) { 45 if ( ! is_array( $query->query_vars['post_status'] ) ) { 46 $query->query_vars['post_status'] = array( 47 $query->query_vars['post_status'] 48 ); 49 } 50 51 $query->query_vars['post_status'][] = 'delist'; 52 } 44 $query->query_vars['post_status'] = array( 45 'publish', 46 'delist', 47 ); 48 } 53 49 54 50 switch ( $query->query_vars['browse'] ) {
Note: See TracChangeset
for help on using the changeset viewer.