Get rid of wp_cache_key(), as it's not really that useful. See [15838]
git-svn-id: http://svn.automattic.com/wordpress/trunk@15839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ea1470d6af
commit
efb8b6abcc
|
@ -279,24 +279,6 @@ function is_serialized_string( $data ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a unique key from an argument
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
*
|
|
||||||
* @param mixed $arg
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function wp_cache_key( $arg ) {
|
|
||||||
if ( is_scalar( $arg ) )
|
|
||||||
return md5( $arg );
|
|
||||||
|
|
||||||
$arg = (array) $arg;
|
|
||||||
sort( $arg );
|
|
||||||
|
|
||||||
return md5( serialize( $arg ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve option value based on name of option.
|
* Retrieve option value based on name of option.
|
||||||
*
|
*
|
||||||
|
|
|
@ -3989,7 +3989,7 @@ function _get_last_post_time( $timezone, $field ) {
|
||||||
|
|
||||||
$post_types = apply_filters( "get_lastpost{$field}_post_types", (array) $post_types );
|
$post_types = apply_filters( "get_lastpost{$field}_post_types", (array) $post_types );
|
||||||
|
|
||||||
$key = "lastpost{$field}:$blog_id:$timezone:" . wp_cache_key( $post_types );
|
$key = "lastpost{$field}:$blog_id:$timezone:" . md5( serialize( $post_types ) );
|
||||||
|
|
||||||
$date = wp_cache_get( $key, 'timeinfo' );
|
$date = wp_cache_get( $key, 'timeinfo' );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue