Making WordPress.org


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

Plugin Directory: Let Reviewers see all pending plugins.

See #1570.

File:
1 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        }
Note: See TracChangeset for help on using the changeset viewer.