Multi Device Switcher - Version 1.0.1

Version Description

  • fixed: split multi_device_switcher_init() into two functions
Download this release

Release Info

Developer thingsym
Plugin Icon wp plugin Multi Device Switcher
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0.0 to 1.0.1

Files changed (3) hide show
  1. multi-device-switcher.php +18 -8
  2. readme.md +3 -1
  3. readme.txt +3 -1
multi-device-switcher.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Multi Device Switcher
4
  Plugin URI: https://github.com/thingsym/multi-device-switcher
5
  Description: This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game).
6
- Version: 1.0.0
7
  Author: Yousuke Mizuno
8
  Author URI: http://www.thingslabo.com/
9
  License: GPL2
@@ -136,6 +136,21 @@ class Multi_Device_Switcher {
136
 
137
  $multi_device_switcher = new Multi_Device_Switcher;
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  /**
140
  * Register the form setting for our multi_device_switcher array.
141
  *
@@ -152,13 +167,6 @@ function multi_device_switcher_init() {
152
  if ( false === multi_device_switcher_get_options() )
153
  add_option( 'multi_device_switcher_options' );
154
 
155
- load_plugin_textdomain('multi-device-switcher', false, 'multi-device-switcher/languages');
156
-
157
- wp_enqueue_style( 'multi-device-switcher-options', WP_PLUGIN_URL . '/multi-device-switcher/multi-device-switcher.css', false, '2011-08-22' );
158
- wp_enqueue_style( 'thickbox', includes_url() . '/js/thickbox/thickbox.css', false, '20090514' );
159
- wp_enqueue_script('jquery-ui-tabs');
160
- wp_enqueue_script( 'multi-device-switcher-options', WP_PLUGIN_URL . '/multi-device-switcher/multi-device-switcher.js', array( 'jquery' ), '2011-08-22' );
161
-
162
  register_setting(
163
  'multi_device_switcher', // Options group, see settings_fields() call in multi_device_switcher_render_page()
164
  'multi_device_switcher_options', // Database option, see multi_device_switcher_get_options()
@@ -211,6 +219,8 @@ function multi_device_switcher_add_page() {
211
 
212
  if ($help)
213
  add_contextual_help( $theme_page, $help );
 
 
214
  }
215
  add_action( 'admin_menu', 'multi_device_switcher_add_page' );
216
 
3
  Plugin Name: Multi Device Switcher
4
  Plugin URI: https://github.com/thingsym/multi-device-switcher
5
  Description: This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game).
6
+ Version: 1.0.1
7
  Author: Yousuke Mizuno
8
  Author URI: http://www.thingslabo.com/
9
  License: GPL2
136
 
137
  $multi_device_switcher = new Multi_Device_Switcher;
138
 
139
+ /**
140
+ * Properly enqueue styles and scripts for our multi_device_switcher options page.
141
+ *
142
+ * This function is attached to the admin_enqueue_scripts action hook.
143
+ *
144
+ * @since 1.0
145
+ *
146
+ */
147
+ function multi_device_switcher_admin_enqueue_scripts( $hook_suffix ) {
148
+ wp_enqueue_style( 'multi-device-switcher-options', WP_PLUGIN_URL . '/multi-device-switcher/multi-device-switcher.css', false, '2011-08-22' );
149
+ wp_enqueue_style( 'thickbox', includes_url() . '/js/thickbox/thickbox.css', false, '20090514' );
150
+ wp_enqueue_script('jquery-ui-tabs');
151
+ wp_enqueue_script( 'multi-device-switcher-options', WP_PLUGIN_URL . '/multi-device-switcher/multi-device-switcher.js', array( 'jquery' ), '2011-08-22' );
152
+ }
153
+
154
  /**
155
  * Register the form setting for our multi_device_switcher array.
156
  *
167
  if ( false === multi_device_switcher_get_options() )
168
  add_option( 'multi_device_switcher_options' );
169
 
 
 
 
 
 
 
 
170
  register_setting(
171
  'multi_device_switcher', // Options group, see settings_fields() call in multi_device_switcher_render_page()
172
  'multi_device_switcher_options', // Database option, see multi_device_switcher_get_options()
219
 
220
  if ($help)
221
  add_contextual_help( $theme_page, $help );
222
+
223
+ add_action( "admin_print_styles-$theme_page", 'multi_device_switcher_admin_enqueue_scripts' );
224
  }
225
  add_action( 'admin_menu', 'multi_device_switcher_add_page' );
226
 
readme.md CHANGED
@@ -13,7 +13,9 @@ This plugin detects if your site is being viewed by UserAgent and switches to se
13
  6. Configure settings to your needs. Select Theme by Theme option. Add and fix UserAgent by UserAgent option if necessary.
14
  7. Have fun!
15
 
16
- ## Changelog
17
 
 
 
18
  * Version 1.0.0
19
  * Initial release.
13
  6. Configure settings to your needs. Select Theme by Theme option. Add and fix UserAgent by UserAgent option if necessary.
14
  7. Have fun!
15
 
16
+ ## Changelog
17
 
18
+ * Version 1.0.1
19
+ * fixed: split multi_device_switcher_init() into two functions
20
  * Version 1.0.0
21
  * Initial release.
readme.txt CHANGED
@@ -6,7 +6,7 @@ Link: https://github.com/thingsym/multi-device-switcher
6
  Tags: switcher, theme, ipad, iphone, android, tablet, mobile, game
7
  Requires at least: 3.2.1
8
  Tested up to: 3.3.1
9
- Stable tag: 1.0.0
10
 
11
  This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game).
12
 
@@ -32,5 +32,7 @@ This plugin detects if your site is being viewed by UserAgent and switches to se
32
 
33
  == Changelog ==
34
 
 
 
35
  = 1.0.0 =
36
  * Initial release.
6
  Tags: switcher, theme, ipad, iphone, android, tablet, mobile, game
7
  Requires at least: 3.2.1
8
  Tested up to: 3.3.1
9
+ Stable tag: 1.0.1
10
 
11
  This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game).
12
 
32
 
33
  == Changelog ==
34
 
35
+ = 1.0.1 =
36
+ * fixed: split multi_device_switcher_init() into two functions
37
  = 1.0.0 =
38
  * Initial release.