check if post_type exists (#34501)
* check if post_type exists * Changelog. Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
This commit is contained in:
parent
ec5092bd5a
commit
d4f2212c8a
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
Resolve an error in the product tracking code by testing to see if the `post_type` query var is set before checking its value.
|
|
@ -317,6 +317,7 @@ class WC_Products_Tracking {
|
|||
|
||||
if (
|
||||
'post-new.php' === $hook &&
|
||||
isset( $_GET['post_type'] ) &&
|
||||
'product' === wp_unslash( $_GET['post_type'] )
|
||||
) {
|
||||
return 'new';
|
||||
|
|
Loading…
Reference in New Issue