PHP Notice: Notice: WP_Scripts::localize was called incorrectly
-
Hello,
I’m getting the following PHP notice cropping up a few times:
Notice: WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.) in /httpdocs/wp-includes/functions.php on line 5313
I’m noticing a few places in the plugin where it calls
wp_localize_script()
and doesn’t pass an array, but something like a string or variable which is incorrect.
- The topic ‘PHP Notice: Notice: WP_Scripts::localize was called incorrectly’ is closed to new replies.