diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 6e8ba5efe5..0a93023add 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -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];