• dblinks

    (@dblinks)


    In the dashboard when activating Post SMTP plugin (error goes away if I deactivate).

    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 /var/www/vhosts/newlife.missionhamilton.org/httpdocs/wp-includes/functions.php on line 5313

    And the server log:

    62804#0: *197015 FastCGI sent in stderr: “PHP message: PHP 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 /var/www/vhosts/newlife.missionhamilton.org/httpdocs/wp-includes/functions.php on line 5313PHP message: PHP 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.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Tim

    (@tneville)

    Hi @dblinks,

    What PHP version is your hosting running?

    Kind Regards,
    Tim

    It isn’t a PHP version issue it’s an issue with WordPress 5.7

    Find:
    wp_localize_script( ‘handle’, ‘object_name’, ‘l10n_culprit_string’ );

    Change to:

    wp_localize_script( ‘handle’, ‘object_name’, array( ‘l10n_culprit_string’ ) );

    • This reply was modified 3 years, 12 months ago by kenrichman.
    • This reply was modified 3 years, 12 months ago by kenrichman.
    Thread Starter dblinks

    (@dblinks)

    Php 7.4.16

    There are 3 posts now covering this, my bad. I found the solution by adding to the wp-config file using debug code:

    define( ‘WP_DEBUG’, false ); // or true if you are ACTIVELY debugging
    define( ‘WP_DEBUG_LOG’, true );
    define( ‘WP_DEBUG_DISPLAY’, false );

    This was brought up by the author (I think) in the other post. I’ve used WP for 12 years never seen the LOG or DISPLAY values used. Pretty cool

    thanks!
    stu

    Stu, you didn’t find the solution, you found a way to hide the problem.

    Escalating to the developer @yehudah for comment.

    Kind Regards,
    Tim

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error when Activating Plugn’ is closed to new replies.