function enqueue_script() { $uniqueStyle = get_option('SnazzyMapDefaultStyle'); if (!empty($uniqueStyle) && !is_null($uniqueStyle)) { $handle = 'snazzymaps-js'; wp_enqueue_script($handle, plugins_url('snazzymaps.js', __FILE__), $deps = array('jquery'), $ver = SNAZZY_VERSION_NUMBER, $in_footer = false); //We have to use l10n_print_after so we can support older versions of WordPress $json = new SnazzyMaps_Services_JSON(); wp_localize_script($handle, 'SnazzyDataForSnazzyMaps', array('l10n_print_after' => 'SnazzyDataForSnazzyMaps=' . $json->encode($uniqueStyle))); } }