Title: WordPress Error Notice: Function WP_Scripts::localize was called incorrectly.
Last modified: October 18, 2023

---

# WordPress Error Notice: Function WP_Scripts::localize was called incorrectly.

 *  [muhammad909](https://wordpress.org/support/users/muhammad909/)
 * (@muhammad909)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/error-notice-function-wp_scriptslocalize-was-called-incorrectly/)
 * 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 2 years, 7 months ago by [muhammad909](https://wordpress.org/support/users/muhammad909/).

Viewing 1 replies (of 1 total)

 *  [Rohan Kamble](https://wordpress.org/support/users/rohu2187/)
 * (@rohu2187)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/error-notice-function-wp_scriptslocalize-was-called-incorrectly/#post-17149555)
 * 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.
 * ![](https://i0.wp.com/rohutech.com/wp-content/uploads/2023/10/WP_Scripts-localize.
   jpg?ssl=1)
 * 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.

 * ![](https://ps.w.org/pardot/assets/icon-256x256.png?rev=2995205)
 * [Account Engagement](https://wordpress.org/plugins/pardot/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pardot/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pardot/)
 * [Active Topics](https://wordpress.org/support/plugin/pardot/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pardot/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pardot/reviews/)

## Tags

 * [wp_localize_script](https://wordpress.org/support/topic-tag/wp_localize_script/)

 * 1 reply
 * 2 participants
 * Last reply from: [Rohan Kamble](https://wordpress.org/support/users/rohu2187/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/error-notice-function-wp_scriptslocalize-was-called-incorrectly/#post-17149555)
 * Status: not resolved