diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index b225d35c48b2a..242f80cf039ad 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2891,6 +2891,10 @@ function get_post_custom_values( $key = '', $post_id = 0 ) { $custom = get_post_custom( $post_id ); + if ( ! is_array( $custom ) ) { + return null; + } + return $custom[ $key ] ?? null; }