/** * Enqueue scripts and styles to theme options page. * @since 1.6 */ function ar2_theme_options_enqueue_scripts($hook_suffix) { global $wp_styles; $current = isset($_GET['opt_type']) ? esc_attr($_GET['opt_type']) : ''; // for media uploading functionality. if (function_exists('wp_enqueue_media')) { wp_enqueue_media(); } else { wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); wp_enqueue_script('media-upload'); } wp_enqueue_style('ar2-theme-options', get_template_directory_uri() . '/css/theme-options.css', null, '2011-07-29'); wp_register_style('ar2-theme-options-ie', get_template_directory_uri() . '/css/theme-options-ie.css'); $wp_styles->add_data('ar2-theme-options-ie', 'conditional', 'lt IE 9'); wp_enqueue_style('ar2-theme-options-ie'); if (is_rtl()) { wp_enqueue_style('ar2-theme-options-rtl', get_template_directory_uri() . '/css/theme-options-rtl.css', null, '2012-08-09'); } wp_enqueue_script('jquery-tokeninput', get_template_directory_uri() . '/js/jquery.tokeninput.min.js', array('jquery'), '2012-08-09'); wp_enqueue_script('ar2-theme-options', get_template_directory_uri() . '/js/theme-options.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'), '2012-08-09'); wp_localize_script('ar2-theme-options', 'ar2Admin_l10n', ar2_theme_options_localize_vars()); }
/** * Stores the localization object to localize scripts. * @since 2.0 */ protected function localize_vars() { $_vars = ar2_theme_options_localize_vars(); define('AR2_CUSTOMIZE_TERMS_LOCALIZED', true); return $_vars; }