From 11295e488e7096ce78452d83a15dba9f04c9ff17 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Wed, 2 Feb 2005 22:52:47 +0000 Subject: [PATCH] Faster way to get_custom strings. git-svn-id: http://svn.automattic.com/wordpress/trunk@2208 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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;