Prevent possible warning in `COTMigrationUtil::get_post_or_object_meta()` (#37026)
This commit is contained in:
commit
3cee72119a
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Prevent possible warning arising from use of woocommerce_wp_* family of functions.
|
|
@ -96,7 +96,7 @@ class COTMigrationUtil {
|
|||
}
|
||||
return $data->get_meta( $key, $single );
|
||||
} else {
|
||||
return get_post_meta( $post->ID, $key, $single );
|
||||
return isset( $post->ID ) ? get_post_meta( $post->ID, $key, $single ) : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue