Fix notices in post_custom(). Props sirzooro. Fixes #11839

git-svn-id: http://svn.automattic.com/wordpress/trunk@13861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-03-28 04:19:44 +00:00
parent bf6510abd1
commit 8abdcecbfe
1 changed files with 4 additions and 2 deletions

View File

@ -655,12 +655,14 @@ function wp_link_pages($args = '') {
* @since 1.5.0
*
* @param string $key Meta data key name.
* @return string|array Array of values or single value, if only one element exists.
* @return bool|string|array Array of values or single value, if only one element exists. False will be returned if key does not exist.
*/
function post_custom( $key = '' ) {
$custom = get_post_custom();
if ( 1 == count($custom[$key]) )
if ( !isset( $custom[$key] ) )
return false;
elseif ( 1 == count($custom[$key]) )
return $custom[$key][0];
else
return $custom[$key];