Making WordPress.org

Changeset 11240


Ignore:
Timestamp:
09/15/2021 11:07:04 AM (3 years ago)
Author:
stankea
Message:

Revert r11239 - seems to be breaking the theme_information endpoint https://meta.trac.wordpress.org/ticket/5906

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/query-modifications.php

    r11239 r11240  
    1313        return;
    1414    }
    15 
    1615    // Themes are never via pagename
    1716    if ( !empty( $query->query_vars['pagename'] ) ) {
     
    2423    }
    2524
    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';
    3127    if ( ! isset( $query->query_vars['browse'] ) ) {
    3228        $query->query_vars['browse'] = '';
     
    3834    }
    3935
    40     // Delisted items should be available on singular / author archives.
     36    // eliminate draft posts from showing up in the directory
    4137    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()
    4443    ) {
    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    }
    5349
    5450    switch ( $query->query_vars['browse'] ) {
Note: See TracChangeset for help on using the changeset viewer.