• We recently installed the Pardot Plugin (version 2.0) on our WordPress site and when I activate the plugin, its gives the following error on the top of the page,

    Notice: Function 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 /opt/bitnami/wordpress/wp-includes/functions.php on line 5905

    I tried switching off the WP Debug by adding the following line in the wp-config.php file, but nothing happened.

    define(‘WP_DEBUG_DISPLAY’, false);

    Does anyone faced this issue before or have any solutions for it?

    Thanks

    • This topic was modified 1 year, 1 month ago by muhammad909.
Viewing 1 replies (of 1 total)
  • I am also getting these notices in my error logs.

    I can clearly see that the wp_localize_script function in wp-content/plugins/pardot/pardot.php file is called with following args

    wp_localize_script( ‘build/index.js’, ‘ajaxurl’, admin_url( ‘includes/admin-ajax.php’ ));

    in which the last arg is expected to be an array as per the function definition.

    but pardot is not passing 3rd arg as an Array instead it is sending admin_url

    Hope this is fixed soon.

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress Error Notice: Function WP_Scripts::localize was called incorrectly.’ is closed to new replies.