PluginProbe
Theme Switcha – Easily Switch Themes for Development and Testing / 3.3
Theme Switcha – Easily Switch Themes for Development and Testing v3.3
3.4.5 trunk 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.3.1 3.3.2 All 33 releases
theme-switcha / inc / resources-enqueue.php

resources-enqueue.php in Theme Switcha – Easily Switch Themes for Development and Testing 3.3, at inc/resources-enqueue.php

57 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php // Theme Switcha - Enqueue Resources
2
3 if (!defined('ABSPATH')) exit;
4
5 function theme_switcha_enqueue_resources_admin() {
6
7 $screen_id = theme_switcha_get_current_screen_id();
8
9 if ($screen_id === 'settings_page_theme_switcha_settings') {
10
11 // wp_enqueue_style($handle, $src, $deps, $ver, $media)
12
13 wp_enqueue_style('wp-jquery-ui-dialog');
14
15 wp_enqueue_style('theme-switcha-font-icons', THEME_SWITCHA_URL .'css/font-icons.css', array(), THEME_SWITCHA_VERSION);
16
17 wp_enqueue_style('theme-switcha-settings', THEME_SWITCHA_URL .'css/settings.css', array(), THEME_SWITCHA_VERSION);
18
19 // wp_enqueue_script($handle, $src, $deps, $ver, $in_footer)
20
21 $js_deps = array('jquery', 'jquery-ui-core', 'jquery-ui-dialog');
22
23 wp_enqueue_script('theme_switcha_settings', THEME_SWITCHA_URL .'js/settings.js', $js_deps, THEME_SWITCHA_VERSION);
24
25 $data = theme_switcha_print_js_vars_admin();
26
27 wp_localize_script('theme_switcha_settings', 'theme_switcha_settings', $data);
28
29 }
30
31 }
32
33 function theme_switcha_print_js_vars_admin() {
34
35 $data = array(
36 'reset_title' => __('Confirm Reset', 'theme-switcha'),
37 'reset_message' => __('Restore default options?', 'theme-switcha'),
38 'reset_true' => __('Yes, make it so.', 'theme-switcha'),
39 'reset_false' => __('No, abort mission.', 'theme-switcha'),
40 );
41
42 return $data;
43
44 }
45
46 function theme_switcha_get_current_screen_id() {
47
48 if (!function_exists('get_current_screen')) require_once ABSPATH .'/wp-admin/includes/screen.php';
49
50 $screen = get_current_screen();
51
52 if ($screen && property_exists($screen, 'id')) return $screen->id;
53
54 return false;
55
56 }
57