Function WP_Scripts::localize was called incorrectly

[ad_1]

Can someone help me fix this error, please?
I know that the plugin snax is the one responsable, but I don’t know what to look for…

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. (This message was added in version 5.7.0.)

WP_Scripts->localize()
wp-includes/class-wp-scripts.php:605
wp_localize_script()
wp-includes/functions.wp-scripts.php:234
snax_collection_enqueue_scripts()
wp-content/plugins/snax/includes/collections/functions.php:157
do_action(‘wp_enqueue_scripts’)
wp-includes/plugin.php:517
wp_enqueue_scripts()
wp-includes/script-loader.php:2262
do_action(‘wp_head’)
wp-includes/plugin.php:517
wp_head()
wp-includes/general-template.php:3052
load_template(‘wp-content/themes/wp-bestofporn/header.php’)
wp-includes/template.php:790
locate_template()
wp-includes/template.php:725
get_header()
wp-includes/general-template.php:48

Line 157 from wp-content/plugins/snax/includes/collections/functions.php:157

wp_localize_script( ‘snax-collections’, ‘snax_collections_js_config’, wp_json_encode( $config ) );

Thank you in advance

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer