Making WordPress.org


Ignore:
Timestamp:
02/05/2021 06:36:01 AM (4 years ago)
Author:
dd32
Message:

Theme Directory: Fix the query logic for the delisted post_status.

This query modification function was overwriting the post_status specified by WPORG_Themes_Upload::get_theme_post().

See #5362.

File:
1 edited

Legend:

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

    r10635 r10642  
    3535
    3636    // eliminate draft posts from showing up in the directory
    37     if ( !isset( $query->query_vars['post_status'] ) ) {
    38         $query->query_vars['post_status'] = 'publish';
    39     }
    40 
    41     if ( !empty( $query->query_vars['name'] ) ) {
    42         $query->query_vars['post_status'] = 'publish,delist';
    43     }
     37    if (
     38        ! isset( $query->query_vars['post_status'] ) ||
     39        'publish' === $query->query_vars['post_status']
     40    ) {
     41        $query->query_vars['post_status'] = array(
     42            'publish',
     43            'delist',
     44        );
     45    }
    4446
    4547    switch ( $query->query_vars['browse'] ) {
Note: See TracChangeset for help on using the changeset viewer.