Prevent possible warning in `COTMigrationUtil::get_post_or_object_meta()` (#37026)

This commit is contained in:
Ron Rennick 2023-03-02 14:05:24 -04:00 committed by GitHub
commit 3cee72119a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Prevent possible warning arising from use of woocommerce_wp_* family of functions.

View File

@ -96,7 +96,7 @@ class COTMigrationUtil {
} }
return $data->get_meta( $key, $single ); return $data->get_meta( $key, $single );
} else { } else {
return get_post_meta( $post->ID, $key, $single ); return isset( $post->ID ) ? get_post_meta( $post->ID, $key, $single ) : false;
} }
} }