Find Answers and Get Support › Forums › Gorgo – Multi-Purpose Gutenberg Blog & Magazine Theme › Website Setup › Pages › WP_Scripts::localize was called incorrectly
- This topic has 1 reply, 2 voices, and was last updated 4 years ago by
Manathan.
-
AuthorPosts
-
MohammadParticipant@mohammad
- 15 Topics
- 31 Posts
Hello, why am I seeing this warning?
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…public_html/wp-includes/functions.php on line 5313
How can i fix it?
April 11, 2021 at 20:17 #30425@themodactyl- 0 Topics
- 6737 Posts
Hi Mohammad,
Thank you for reaching out! We’re sorry for the late answer. We’re experiencing a much larger number of requests than usual.
No worries. These are PHP warnings, not errors. Unlike errors, warnings won’t break your website. They’re just messages aimed at developers to improve their code.
My best guess is that this issue is related with your php version. Please check the WordPress prerequisites here:
WordPress requirementsFor more about this, please click on the following link:
Getting notice is wordpress “WP_Scripts::localize was called incorrectly”To hide this message, I suggest that you activate error logging on your website. Please keep WP_DEBUG to true and just paste the following code lines in your wp-config.php file, just before the line that says ‘That’s all, stop editing! Happy blogging.’:
// Enable WP_DEBUG mode define( 'WP_DEBUG', true ); // Enable Debug logging to the /wp-content/debug.log file define( 'WP_DEBUG_LOG', true ); // Disable display of errors and warnings define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 );
More on this in the following topic: Debugging in WordPress
You will still be able to consult the warnings and errors triggered by your website but these won’t appear on your pages anymore.
Regards,
April 13, 2021 at 09:34 #30535 -
AuthorPosts
Hi there,
This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!
Best regards,
The Themosaurus team.
The topic ‘WP_Scripts::localize was called incorrectly’ is closed to new replies.