WP 5.7 – Notice: WP_Scripts::localize was called incorrectly.
-
Hi, upon updating to WordPress 5.7, we received this notice on multiple websites:
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 /home/customer/public_html/wp-includes/functions.php on line 5313
I traced this problem to the Post SMTP plugin, in
wp-content/plugins/post-smtp/Postman/PostmanViewController.php.
The wp_localize_script calls on line 173 are throwing a notice because they are passing a string, not an array, from what I can tell.
- The topic ‘WP 5.7 – Notice: WP_Scripts::localize was called incorrectly.’ is closed to new replies.