Support » Plugin: Post SMTP Mailer/Email Log » WP 5.7 – Notice: WP_Scripts::localize was called incorrectly.

  • Resolved askpivot

    (@askpivot)


    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.

    • This topic was modified 7 months, 1 week ago by askpivot. Reason: Removed private path info
Viewing 3 replies - 16 through 18 (of 18 total)
  • Running WP 5.8 and just installed the plugin on a new site and am getting that error… Is the only way to disable/fix this to use the filter from @kamranmayo or is there another fix?

    • This reply was modified 1 month, 4 weeks ago by MagineM.

    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 /home3/indiarpm/public_html/kfsindia.com/wp-includes/functions.php on line 5663

    I’m getting this error on a WP 5.8.1 and I don’t have the Post SMTP plugin installed. It’s a multisite.

Viewing 3 replies - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.