diff --git a/plugins/woocommerce/changelog/fix-35543 b/plugins/woocommerce/changelog/fix-35543 new file mode 100644 index 00000000000..a427c9577b6 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-35543 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Prevent possible warning arising from use of woocommerce_wp_* family of functions. diff --git a/plugins/woocommerce/src/Internal/Utilities/COTMigrationUtil.php b/plugins/woocommerce/src/Internal/Utilities/COTMigrationUtil.php index 1f0d52cc547..c1be7077e7b 100644 --- a/plugins/woocommerce/src/Internal/Utilities/COTMigrationUtil.php +++ b/plugins/woocommerce/src/Internal/Utilities/COTMigrationUtil.php @@ -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; } }