WordPress.org

Making WordPress.org


Ignore:
Timestamp:
04/11/2016 11:33:19 AM (4 years ago)
Author:
obenland
Message:

Plugin Directory: Make sure pagination in plugin list works.

See #1570.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php

    r2926 r2927  
    137137        }
    138138
     139        if ( empty( $query->query['post_status'] ) ) {
     140            $query->query_vars['post_status'] = array( 'publish', 'future', 'draft', 'pending', 'disabled', 'closed', 'rejected' );
     141        }
     142
    139143        if ( ! current_user_can( 'plugin_edit_others' ) || ( isset( $query->query['author'] ) && $query->query['author'] == get_current_user_id() ) ) {
    140144            $query->query_vars['author'] = get_current_user_id();
     145
    141146            $plugins = Tools::get_users_write_access_plugins( get_current_user_id() );
    142 
    143147            if ( $plugins ) {
    144148                $query->query_vars['post_name__in'] = $plugins;
     
    165169
    166170        // Allow reviewers to also see all pending plugins.
    167         if ( current_user_can( 'plugin_edit_pending' ) && ! isset( $_GET['author'] ) ) {
     171        if ( current_user_can( 'plugin_edit_pending' ) && ( ! isset( $_GET['author'] ) || ( isset( $_GET['post_status'] ) && 'pending' === $_GET['post_status'] ) ) ) {
    168172            $where .= " OR {$wpdb->posts}.post_status = 'pending'";
    169173        }
     
    183187        if ( 'plugin' === $post_type ) {
    184188            $wp_list_table = new Plugin_Posts();
     189            $wp_list_table->prepare_items();
    185190        }
    186191    }
Note: See TracChangeset for help on using the changeset viewer.