Function WP_Scripts::localize was called incorrectly
-
With the latest WP 6.2 I’m getting this notice:
plugins\wpvr\admin\class-wpvr-admin.php:243
[03-Apr-2023 09:47:06 UTC] PHP Notice: ?Function WP_Scripts::localize was called <strong>incorrectly</strong>. The <code>$l10n</code> parameter must be an array. To pass arbitrary data to scripts, use the <code>wp_add_inline_script()</code> function instead. Please see <a href="https://www.ads-software.com/documentation/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.7.0.) in xxxxxxxx\wp-includes\functions.php on line 5865 [03-Apr-2023 09:47:06 UTC] PHP Stack trace: [03-Apr-2023 09:47:06 UTC] PHP ? 1. {main}() xxxxxxxx\wp-admin\admin.php:0 [03-Apr-2023 09:47:06 UTC] PHP ? 2. require_once() xxxxxxxx\wp-admin\admin.php:239 [03-Apr-2023 09:47:06 UTC] PHP ? 3. do_action() xxxxxxxx\wp-admin\admin-header.php:118 [03-Apr-2023 09:47:06 UTC] PHP ? 4. WP_Hook->do_action() xxxxxxxx\wp-includes\plugin.php:517 [03-Apr-2023 09:47:06 UTC] PHP ? 5. WP_Hook->apply_filters() xxxxxxxx\wp-includes\class-wp-hook.php:332 [03-Apr-2023 09:47:06 UTC] PHP ? 6. Wpvr_Admin->enqueue_scripts() xxxxxxxx\wp-includes\class-wp-hook.php:308 [03-Apr-2023 09:47:06 UTC] PHP ? 7. wp_localize_script() xxxxxxxx\wp-content\plugins\wpvr\admin\class-wpvr-admin.php:243 [03-Apr-2023 09:47:06 UTC] PHP ? 8. WP_Scripts->localize() xxxxxxxx\wp-includes\functions.wp-scripts.php:221 [03-Apr-2023 09:47:06 UTC] PHP ? 9. _doing_it_wrong() xxxxxxxx\wp-includes\class-wp-scripts.php:502 [03-Apr-2023 09:47:06 UTC] PHP ?10. trigger_error() xxxxxxxx\wp-includes\functions.php:5865
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Function WP_Scripts::localize was called incorrectly’ is closed to new replies.