WordPress.org

Making WordPress.org

Changeset 9227


Ignore:
Timestamp:
10/24/2019 02:03:33 AM (18 months ago)
Author:
dd32
Message:

Plugin Directory: API: Only query for 'publish'd plugins.

The Disabled and Closed post_status's are now public statuses, but are not intended to be available through the API, this inflates the number of plugins that the API claims to have, but can't actually return.

Fixes #4778.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-query-plugins.php

    r9138 r9227  
    9898        }
    9999
    100         $query['post_type'] = 'plugin';
     100        $query['post_type']   = 'plugin';
     101        $query['post_status'] = 'publish';
    101102
    102103        // Use the main query so that is_main_query() is triggered for the filters.
    103104        $wp_query->query( $query );
    104 
    105105        $response['info']['page']    = (int) $wp_query->get( 'paged' ) ?: 1;
    106106        $response['info']['pages']   = (int) $wp_query->max_num_pages ?: 0;
Note: See TracChangeset for help on using the changeset viewer.