Ticket #17025: 17025.2.diff
File 17025.2.diff, 1.0 KB (added by , 11 years ago) |
---|
-
src/wp-includes/author-template.php
283 283 $query_args['fields'] = 'ids'; 284 284 $authors = get_users( $query_args ); 285 285 286 $sql = "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author"; 287 288 /** 289 * Filter the authors SQL query. 290 * 291 * @since 3.7.0 292 * 293 * @param string $sql The authors SQL query. 294 */ 295 $rows = $wpdb->get_results( apply_filters( 'list_authors_query', $sql ) ); 296 286 297 $author_count = array(); 287 foreach ( (array) $ wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author")as $row )298 foreach ( (array) $rows as $row ) 288 299 $author_count[$row->post_author] = $row->count; 289 300 290 301 foreach ( $authors as $author_id ) {