SHARE
TWEET

Untitled

a guest Sep 17th, 2011 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wp_enqueue_script( 'my-script', get_bloginfo('template_directory') . '/js/custom_script.js' );
  2. $params = array(
  3.     0 => array(
  4.         'lat' => '35',
  5.         'long' => '45'
  6.     ),
  7.     1 => array(
  8.         'lat' => '40',
  9.         'long' => '50'
  10.     )
  11. );
  12. $encoded_data = array( 'l10n_print_after' => 'myloc = '.json_encode($params).';' );
  13. wp_localize_script(  'my-script', 'myloc', $encoded_data  );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top