### Eclipse Workspace Patch 1.0
#P trunk.domain
|
|
|
|
| 363 | 363 | echo $return; |
| 364 | 364 | } |
| 365 | 365 | |
| | 366 | /** |
| | 367 | * Does this site have more than one author |
| | 368 | * |
| | 369 | * Checks to see if more than one author has published posts. |
| | 370 | * |
| | 371 | * @return bool Whether or not we have more than one author |
| | 372 | */ |
| | 373 | function is_multi_author() { |
| | 374 | global $wpdb; |
| | 375 | |
| | 376 | if ( ! $author_count = wp_cache_get('author_count', 'posts') ) { |
| | 377 | $author_count = $wpdb->get_var("SELECT COUNT( DISTINCT post_author ) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'"); |
| | 378 | wp_cache_set('author_count', $author_count, 'posts'); |
| | 379 | } |
| | 380 | |
| | 381 | return $author_count > 1; |
| | 382 | } |
| | 383 | |
| | 384 | /** |
| | 385 | * Helper function to clear the cache for number of authors. |
| | 386 | * |
| | 387 | * @private |
| | 388 | */ |
| | 389 | function __clear_multi_author_cache() { |
| | 390 | wp_cache_delete('author_count', 'posts'); |
| | 391 | } |
| | 392 | add_action('transition_post_status', '__clear_multi_author_cache'); |
| | 393 | |
| 366 | 394 | ?> |