Ticket #24445: 24445.diff
File 24445.diff, 1.1 KB (added by , 11 years ago) |
---|
-
wp-includes/author-template.php
function wp_list_authors($args = '') { 372 372 function is_multi_author() { 373 373 global $wpdb; 374 374 375 if ( false === ( $is_multi_author = wp_cache_get('is_multi_author', 'posts') ) ) {375 if ( false === ( $is_multi_author = get_transient( 'is_multi_author' ) ) ) { 376 376 $rows = (array) $wpdb->get_col("SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 2"); 377 377 $is_multi_author = 1 < count( $rows ) ? 1 : 0; 378 wp_cache_set('is_multi_author', $is_multi_author, 'posts');378 set_transient( 'is_multi_author', $is_multi_author ); 379 379 } 380 380 381 381 return apply_filters( 'is_multi_author', (bool) $is_multi_author ); … … function is_multi_author() { 387 387 * @private 388 388 */ 389 389 function __clear_multi_author_cache() { 390 wp_cache_delete('is_multi_author', 'posts');390 delete_transient( 'is_multi_author' ); 391 391 } 392 392 add_action('transition_post_status', '__clear_multi_author_cache');