Changeset 2831 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
- Timestamp:
- 03/28/2016 07:11:35 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r2798 r2831 155 155 */ 156 156 public function pre_get_posts_sql_name_or_user( $where ) { 157 global $wpdb; 158 157 159 remove_filter( 'posts_where', array( $this, 'pre_get_posts_sql_name_or_user' ) ); 158 160 159 161 // Replace `post_name IN(..) AND post_author IN (..)` 160 162 // With `( post_name IN() OR post_author IN() )` 161 162 163 $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 163 170 return $where; 164 171 }
Note: See TracChangeset
for help on using the changeset viewer.