Make WordPress Core

Changeset 24628


Ignore:
Timestamp:
07/10/2013 04:20:41 AM (10 years ago)
Author:
nacin
Message:

Switch to a transient for is_multi_author(). props markjaquith, fixes #24445.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/author-template.php

    r23528 r24628  
    373373    global $wpdb;
    374374
    375     if ( false === ( $is_multi_author = wp_cache_get('is_multi_author', 'posts') ) ) {
     375    if ( false === ( $is_multi_author = get_transient( 'is_multi_author' ) ) ) {
    376376        $rows = (array) $wpdb->get_col("SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 2");
    377377        $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 );
    379379    }
    380380
     
    388388 */
    389389function __clear_multi_author_cache() {
    390     wp_cache_delete('is_multi_author', 'posts');
     390    delete_transient( 'is_multi_author' );
    391391}
    392392add_action('transition_post_status', '__clear_multi_author_cache');
Note: See TracChangeset for help on using the changeset viewer.