Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wp_enqueue_script( 'my-script', get_bloginfo('template_directory') . '/js/custom_script.js' );
- $params = array(
- 0 => array(
- 'lat' => '35',
- 'long' => '45'
- ),
- 1 => array(
- 'lat' => '40',
- 'long' => '50'
- )
- );
- $encoded_data = array( 'l10n_print_after' => 'myloc = '.json_encode($params).';' );
- wp_localize_script( 'my-script', 'myloc', $encoded_data );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement