diff --git a/plugins/woocommerce/changelog/fix-32956-notice-on-empty-product-page b/plugins/woocommerce/changelog/fix-32956-notice-on-empty-product-page new file mode 100644 index 00000000000..e6c1d8f2191 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-32956-notice-on-empty-product-page @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix notice on emptry product page diff --git a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Products.php b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Products.php index 7a78bf41c2e..72dd99e3df3 100644 --- a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Products.php +++ b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Products.php @@ -158,8 +158,7 @@ class Products extends Task { * @param string $hook Page hook. */ public function possibly_add_load_sample_return_notice_script( $hook ) { - global $post; - if ( 'edit.php' !== $hook || 'product' !== $post->post_type ) { + if ( 'edit.php' !== $hook || 'product' !== get_query_var( 'post_type' ) ) { return; }