Ticket #34993: 34993.2.patch
File 34993.2.patch, 1010 bytes (added by , 9 years ago) |
---|
-
wp-admin/users.php
211 211 else 212 212 $userids = array_map( 'intval', (array) $_REQUEST['users'] ); 213 213 214 $users_posts = new WP_Query( array( 215 'post_type' => 'any', 216 'author' => implode( ',', $userids ), 217 'posts_per_page' => 1 218 ) ); 214 global $wpdb; 219 215 220 if ( $users_posts->have_posts() ) { 216 $users_posts = $wpdb->get_results( 217 "SELECT post_author, COUNT(*) as post_count 218 FROM $wpdb->posts 219 WHERE post_author IN ( " . implode( ',', $userids ) . " ) 220 GROUP BY post_author" 221 ); 222 223 if ( ! empty( $users_posts ) ) { 221 224 add_action( 'admin_head', 'delete_users_add_js' ); 222 225 } 223 226 … … 257 260 </ul> 258 261 <?php if ( $go_delete ) : 259 262 260 if ( ! $users_posts->have_posts() ) : ?>263 if ( empty( $users_posts ) ) : ?> 261 264 <input type="hidden" name="delete_option" value="delete" /> 262 265 <?php else: ?> 263 266 <?php if ( 1 == $go_delete ) : ?>