Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wp_enqueue_scripts', function () {
- wp_enqueue_script('main.js', asset_path('scripts/main.js'), ['jquery'], null, true);
- if (is_front_page()) {
- $shops = ['a', 'b', 'c'];
- wp_localize_script('main.js', 'shopItems', $shops);
- }
- }, 100);
- add_action('wp_enqueue_scripts', function () {
- wp_enqueue_script('main.js', asset_path('scripts/main.js'), ['jquery'], null, true);
- $shops = ['a', 'b', 'c'];
- wp_localize_script('main.js', 'shopItems', $shops);
- }, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement