From cc9e610760f7698e8694678e7d9287ec1ee62276 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Wed, 2 Feb 2005 22:52:47 +0000 Subject: [PATCH] Faster way to get_custom strings. git-svn-id: https://develop.svn.wordpress.org/trunk@2208 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/template-functions-post.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-includes/template-functions-post.php b/wp-includes/template-functions-post.php index c5cd8e3ecb..33abca2510 100644 --- a/wp-includes/template-functions-post.php +++ b/wp-includes/template-functions-post.php @@ -244,6 +244,11 @@ function get_post_custom_values($key='') { return $post_meta_cache[$id][$key]; } +function post_custom( $key = '' ) { + if ( 1 == count($post_meta_cache[$id][$key]) ) return $post_meta_cache[$id][$key][0]; + else return $post_meta_cache[$id][$key]; +} + // this will probably change at some point... function the_meta() { global $id, $post_meta_cache;