PHP Notice: Function wp_script_is was called incorrectly (zoom handle)
-
Hi WooCommerce team,
After updating to WooCommerce 10.3.0, I started seeing this notice in my PHP error log:
PHP Notice: Function wp_script_is was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the 'zoom' handle.Backtrace (from debug log):
#6 /wp-content/plugins/woocommerce/includes/class-wc-frontend-scripts.php:67 wp_script_is #7 /wp-includes/class-wp-hook.php:324 add_legacy_script_warnings #8 /wp-includes/class-wp-hook.php:348 apply_filters #9 /wp-includes/plugin.php:517 do_action #10 /wp-includes/load.php:1304 do_actionEnvironment:
- WordPress version: Latest (6.8.3)
- WooCommerce version: Latest (10.3.0)
- PHP version: 8.3.26
It appears
wp_script_is('zoom')is being called beforewp_enqueue_scripts, which triggers the “doing it wrong” notice.
This didn’t appear prior to 10.3.0, so it may have been introduced by a recent change inWC_Frontend_Scripts.Thank you for looking into it!
David
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
The topic ‘PHP Notice: Function wp_script_is was called incorrectly (zoom handle)’ is closed to new replies.