WordPress.org

Making WordPress.org

Changeset 2831


Ignore:
Timestamp:
03/28/2016 07:11:35 PM (3 years ago)
Author:
obenland
Message:

Plugin Directory: Let Reviewers see all pending plugins.

See #1570.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin
Files:
2 edited

Legend:

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

    r2798 r2831  
    155155     */
    156156    public function pre_get_posts_sql_name_or_user( $where ) {
     157        global $wpdb;
     158
    157159        remove_filter( 'posts_where', array( $this, 'pre_get_posts_sql_name_or_user' ) );
    158160
    159161        // Replace `post_name IN(..) AND post_author IN (..)`
    160162        // With `( post_name IN() OR post_author IN() )`
    161 
    162163        $where = preg_replace( "!\s(\S+\.post_name IN .+?)\s*AND\s*(\s\S+\.post_author.+?)AND!i", ' ( $1 OR $2 ) AND', $where );
     164
     165        // Allow reviewers to also see all pending plugins.
     166        if ( current_user_can( 'plugin_edit_pending' ) ) {
     167            $where .= " OR {$wpdb->posts}.post_status = 'pending'";
     168        }
     169
    163170        return $where;
    164171    }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php

    r2798 r2831  
    331331            );
    332332
    333             if ( ! current_user_can( 'plugin_edit_others' ) ) {
     333            if ( ! current_user_can( 'plugin_edit_others' ) && ! current_user_can( 'plugin_edit_pending' ) ) {
    334334                $status_links['mine'] = $this->get_edit_link( $mine_args, $mine_inner_html, 'current' );;
    335335                return $status_links;
Note: See TracChangeset for help on using the changeset viewer.