The $l10n parameter must be an array
-
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.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘The $l10n parameter must be an array’ is closed to new replies.