Fix notice on emptry product page

This commit is contained in:
Chi-Hsuan Huang 2022-05-12 09:24:08 +08:00
parent a287963fa4
commit 03731c64d5
1 changed files with 1 additions and 2 deletions

View File

@ -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;
}