WordPress.org

Make WordPress Core

Changeset 15839


Ignore:
Timestamp:
10/18/10 21:54:39 (4 years ago)
Author:
scribu
Message:

Get rid of wp_cache_key(), as it's not really that useful. See [15838]

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r15838 r15839  
    278278        return true; 
    279279    return false; 
    280 } 
    281  
    282 /** 
    283  * Generates a unique key from an argument 
    284  *  
    285  * @since 3.1 
    286  * 
    287  * @param mixed $arg 
    288  * @return string 
    289  */ 
    290 function wp_cache_key( $arg ) { 
    291     if ( is_scalar( $arg ) ) 
    292         return md5( $arg ); 
    293  
    294     $arg = (array) $arg; 
    295     sort( $arg ); 
    296  
    297     return md5( serialize( $arg ) ); 
    298280} 
    299281 
  • trunk/wp-includes/post.php

    r15838 r15839  
    39903990    $post_types = apply_filters( "get_lastpost{$field}_post_types", (array) $post_types ); 
    39913991 
    3992     $key = "lastpost{$field}:$blog_id:$timezone:" . wp_cache_key( $post_types ); 
     3992    $key = "lastpost{$field}:$blog_id:$timezone:" . md5( serialize( $post_types ) ); 
    39933993 
    39943994    $date = wp_cache_get( $key, 'timeinfo' ); 
Note: See TracChangeset for help on using the changeset viewer.