WordPress.org

Make WordPress Core

Changeset 7753


Ignore:
Timestamp:
04/20/08 21:28:52 (6 years ago)
Author:
ryan
Message:

Don't include perm as part of cache key if perm is not used in the query.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/wp-includes/post.php

    r7744 r7753  
    828828 
    829829    $cache_key = $type; 
    830     if ( !empty($perm) ) 
    831         $cache_key .= '_' . $perm; 
    832830 
    833831    $query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s"; 
    834832    if ( 'readable' == $perm && is_user_logged_in() ) { 
    835833        if ( !current_user_can("read_private_{$type}s") ) { 
    836             $cache_key .= '_' . $user->ID; 
     834            $cache_key .= '_' . $perm . '_' . $user->ID; 
    837835            $query .= " AND (post_status != 'private' OR ( post_author = '$user->ID' AND post_status = 'private' ))"; 
    838836        } 
Note: See TracChangeset for help on using the changeset viewer.