Merge pull request #32973 from woocommerce/fix/32956-notice-on-empty-product-page

Fix notice on empty product page
This commit is contained in:
Chi-Hsuan Huang 2022-05-13 10:33:28 +08:00 committed by GitHub
commit eb5ef8dfc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix notice on emptry product page

View File

@ -158,8 +158,7 @@ class Products extends Task {
* @param string $hook Page hook. * @param string $hook Page hook.
*/ */
public function possibly_add_load_sample_return_notice_script( $hook ) { public function possibly_add_load_sample_return_notice_script( $hook ) {
global $post; if ( 'edit.php' !== $hook || 'product' !== get_query_var( 'post_type' ) ) {
if ( 'edit.php' !== $hook || 'product' !== $post->post_type ) {
return; return;
} }