From efb8b6abcca4317fafccef7350e403de2857824a Mon Sep 17 00:00:00 2001 From: scribu Date: Mon, 18 Oct 2010 21:54:39 +0000 Subject: [PATCH] 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 --- wp-includes/functions.php | 20 +------------------- wp-includes/post.php | 4 ++-- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f08022fdb6..61c53202a8 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -279,24 +279,6 @@ function is_serialized_string( $data ) { 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. * @@ -4436,4 +4418,4 @@ function wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override = ar */ function no_admin_bar() { define('WP_SHOW_ADMIN_BAR', false); -} \ No newline at end of file +} diff --git a/wp-includes/post.php b/wp-includes/post.php index 4a4c61668f..061ad7e382 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3989,7 +3989,7 @@ function _get_last_post_time( $timezone, $field ) { $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' ); @@ -5048,4 +5048,4 @@ function wp_quickpress_form( $args = array(), $post_type = 'post'){ endif; } -?> \ No newline at end of file +?>