The $l10n parameter must be an array

[ad_1]

Hey guys. I’m getting this error in the following lines:

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:

wp_localize_script( ‘snax-front’, ‘snax_front_config’, wp_json_encode( $front_config ) );
wp_localize_script( ‘snax-shares’, ‘snax_shares_config’, wp_json_encode( $config ) );
wp_localize_script( ‘snax-collections’, ‘snax_collections_js_config’, wp_json_encode( $config ) );
Can someone help me, please?

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