Multi Device Switcher - Version 1.0.2

Version Description

  • added: add file uninstall.php
  • fixed: split admin_enqueue_scripts() into two functions
  • fixed: detects is_admin()
Download this release

Release Info

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

Code changes from version 1.0.1 to 1.0.2

Files changed (4) hide show
  1. multi-device-switcher.php +20 -7
  2. readme.md +5 -1
  3. readme.txt +7 -3
  4. uninstall.php +12 -0
multi-device-switcher.php CHANGED
@@ -3,8 +3,8 @@
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
10
  */
@@ -134,10 +134,11 @@ class Multi_Device_Switcher {
134
  }
135
  }
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
  *
@@ -145,12 +146,23 @@ $multi_device_switcher = new Multi_Device_Switcher;
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
  *
@@ -220,7 +232,8 @@ function multi_device_switcher_add_page() {
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
 
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.2
7
+ Author: thingsym
8
  Author URI: http://www.thingslabo.com/
9
  License: GPL2
10
  */
134
  }
135
  }
136
 
137
+ if ( ! is_admin() )
138
+ $multi_device_switcher = new Multi_Device_Switcher;
139
 
140
  /**
141
+ * Properly enqueue scripts for our multi_device_switcher options page.
142
  *
143
  * This function is attached to the admin_enqueue_scripts action hook.
144
  *
146
  *
147
  */
148
  function multi_device_switcher_admin_enqueue_scripts( $hook_suffix ) {
 
 
149
  wp_enqueue_script('jquery-ui-tabs');
150
  wp_enqueue_script( 'multi-device-switcher-options', WP_PLUGIN_URL . '/multi-device-switcher/multi-device-switcher.js', array( 'jquery' ), '2011-08-22' );
151
  }
152
 
153
+ /**
154
+ * Properly enqueue styles for our multi_device_switcher options page.
155
+ *
156
+ * This function is attached to the admin_enqueue_styles action hook.
157
+ *
158
+ * @since 1.0
159
+ *
160
+ */
161
+ function multi_device_switcher_admin_enqueue_styles( $hook_suffix ) {
162
+ wp_enqueue_style( 'multi-device-switcher-options', WP_PLUGIN_URL . '/multi-device-switcher/multi-device-switcher.css', false, '2011-08-22' );
163
+ wp_enqueue_style( 'thickbox', includes_url() . '/js/thickbox/thickbox.css', false, '20090514' );
164
+ }
165
+
166
  /**
167
  * Register the form setting for our multi_device_switcher array.
168
  *
232
  if ($help)
233
  add_contextual_help( $theme_page, $help );
234
 
235
+ add_action( "admin_print_scripts-$theme_page", 'multi_device_switcher_admin_enqueue_scripts' );
236
+ add_action( "admin_print_styles-$theme_page", 'multi_device_switcher_admin_enqueue_styles' );
237
  }
238
  add_action( 'admin_menu', 'multi_device_switcher_add_page' );
239
 
readme.md CHANGED
@@ -7,7 +7,7 @@ This plugin detects if your site is being viewed by UserAgent and switches to se
7
 
8
  1. Unzip files.
9
  2. Upload "multi-device-switcher" to the "/wp-content/plugins/" directory.
10
- 3. Activate the plugin through the 'Plugins' menu in WordPress
11
  4. Upload a separate theme to the "/wp-content/themes/" directory.
12
  5. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
13
  6. Configure settings to your needs. Select Theme by Theme option. Add and fix UserAgent by UserAgent option if necessary.
@@ -15,6 +15,10 @@ This plugin detects if your site is being viewed by UserAgent and switches to se
15
 
16
  ## Changelog
17
 
 
 
 
 
18
  * Version 1.0.1
19
  * fixed: split multi_device_switcher_init() into two functions
20
  * Version 1.0.0
7
 
8
  1. Unzip files.
9
  2. Upload "multi-device-switcher" to the "/wp-content/plugins/" directory.
10
+ 3. Activate the plugin through the 'Plugins' menu in WordPress.
11
  4. Upload a separate theme to the "/wp-content/themes/" directory.
12
  5. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
13
  6. Configure settings to your needs. Select Theme by Theme option. Add and fix UserAgent by UserAgent option if necessary.
15
 
16
  ## Changelog
17
 
18
+ * Version 1.0.2
19
+ * added: add file uninstall.php
20
+ * fixed: split admin_enqueue_scripts() into two functions
21
+ * fixed: detects is_admin()
22
  * Version 1.0.1
23
  * fixed: split multi_device_switcher_init() into two functions
24
  * Version 1.0.0
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === Multi Device Switcher ===
2
 
3
- Contributors: Yousuke Mizuno
4
  Donate link: http://blog.thingslabo.com/archives/000251.html
5
  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.1
10
 
11
  This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game).
12
 
@@ -24,7 +24,7 @@ This plugin detects if your site is being viewed by UserAgent and switches to se
24
 
25
  1. Unzip files.
26
  2. Upload "multi-device-switcher" to the "/wp-content/plugins/" directory.
27
- 3. Activate the plugin through the 'Plugins' menu in WordPress
28
  4. Upload a separate theme to the "/wp-content/themes/" directory.
29
  5. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
30
  6. Configure settings to your needs. Select Theme by Theme option. Add and fix UserAgent by UserAgent option if necessary.
@@ -32,6 +32,10 @@ This plugin detects if your site is being viewed by UserAgent and switches to se
32
 
33
  == Changelog ==
34
 
 
 
 
 
35
  = 1.0.1 =
36
  * fixed: split multi_device_switcher_init() into two functions
37
  = 1.0.0 =
1
  === Multi Device Switcher ===
2
 
3
+ Contributors: thingsym
4
  Donate link: http://blog.thingslabo.com/archives/000251.html
5
  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.2
10
 
11
  This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game).
12
 
24
 
25
  1. Unzip files.
26
  2. Upload "multi-device-switcher" to the "/wp-content/plugins/" directory.
27
+ 3. Activate the plugin through the 'Plugins' menu in WordPress.
28
  4. Upload a separate theme to the "/wp-content/themes/" directory.
29
  5. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
30
  6. Configure settings to your needs. Select Theme by Theme option. Add and fix UserAgent by UserAgent option if necessary.
32
 
33
  == Changelog ==
34
 
35
+ = 1.0.2 =
36
+ * added: add file uninstall.php
37
+ * fixed: split admin_enqueue_scripts() into two functions
38
+ * fixed: detects is_admin()
39
  = 1.0.1 =
40
  * fixed: split multi_device_switcher_init() into two functions
41
  = 1.0.0 =
uninstall.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) )
4
+ exit();
5
+
6
+ function multi_device_switcher_delete_plugin() {
7
+ delete_option( 'multi_device_switcher_options' );
8
+ }
9
+
10
+ multi_device_switcher_delete_plugin();
11
+
12
+ ?>