Skip to content

Commit

Permalink
Merge pull request #1167 from 10up/fix/1107
Browse files Browse the repository at this point in the history
Check return value of get_post_meta
  • Loading branch information
jeffpaul authored Jul 29, 2024
2 parents 28e6abc + 5898479 commit c8069ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,13 @@ function excluded_meta() {
*/
function prepare_meta( $post_id ) {
update_postmeta_cache( array( $post_id ) );
$meta = get_post_meta( $post_id );
$meta = get_post_meta( $post_id );

if ( false === $meta ) {
return array();
}

$meta = is_array( $meta ) ? $meta : array();
$prepared_meta = array();
$excluded_meta = excluded_meta();

Expand Down

0 comments on commit c8069ca

Please sign in to comment.