PluginProbe
Multi Device Switcher / 1.4.2
Multi Device Switcher v1.4.2
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 All 34 releases
multi-device-switcher / readme.txt

readme.txt in Multi Device Switcher 1.4.2, at readme.txt

444 lines 12.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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.4
8 Tested up to: 4.2
9 Stable tag: 1.4.2
10 License: GPL2 or later
11 License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
13 This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game and custom).
14
15 == Description ==
16
17 This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game and custom).
18 This plugin detects if your site is being viewed by UserAgent, and switches to selected theme.
19 The Custom Switcher can add every device.
20
21
22 = Features =
23
24 * Set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game), switches to selected theme.
25 * Add every device by the **Custom Switcher**.
26 * Add links 'Mobile' or 'PC' in the theme by the **PC Switcher**, switch to the default theme.
27 * Switch the content of the post or page for each device by the **Display Switcher** Shortcode.
28 * Disable the switching of the theme for each url by the **Disable Switcher**.
29 * Can be using **is_multi_device()** function that detect of the device.
30 * **Multi Device Switcher Command** command-line tool (required WP-CLI)
31
32 = Contributing =
33
34 = Patches and Bug Fixes =
35
36 Small patches and bug reports can be submitted a issue tracker in Github. Forking on Github is another good way. You can send a pull request.
37
38 = Contributors =
39
40 * hykw
41
42 = Translations =
43
44 Translating a plugin takes a lot of time, effort, and patience. I really appreciate the hard work from these contributors.
45
46 If you have created or updated your own language pack, you can send [gettext PO and MO files](http://codex.wordpress.org/Translating_WordPress) to author. I can bundle it into Multi Device Switcher.
47
48 = Translator =
49
50 * Japanese (ja) - <a href="http://global.thingslabo.com/blog/">Thingsym</a>
51
52 = The latest PO and MO files =
53
54 * [POT file](http://plugins.svn.wordpress.org/multi-device-switcher/trunk/languages/multi-device-switcher.pot)
55 * [PO files](http://plugins.svn.wordpress.org/multi-device-switcher/trunk/languages/)
56
57 = Send your own language pack =
58
59 You can send your own language pack to author.
60
61 * [multi-device-switcher - GitHub](https://github.com/thingsym/multi-device-switcher)
62 * [http://global.thingslabo.com/blog/ (en)](http://global.thingslabo.com/blog/)
63 * [http://blog.thingslabo.com (ja)](http://blog.thingslabo.com)
64
65 == Screenshots ==
66
67 1. Theme option
68 2. UserAgent option
69 3. PC Switcher option
70 4. PC Switcher button
71 5. Disable Switcher
72
73 == Installation ==
74
75 1. Download and unzip files. Or install multi-device-switcher using the WordPress plugin installer. In that case, skip 2.
76 2. Upload "multi-device-switcher" to the "/wp-content/plugins/" directory.
77 3. Activate the plugin through the 'Plugins' menu in WordPress.
78 4. Upload a separate theme to the "/wp-content/themes/" directory.
79 5. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
80 6. Configure settings to your needs. Select Theme by Theme option. Add and fix UserAgent by UserAgent option if necessary.
81 7. Have fun!
82
83 = How to add the Custom Switcher =
84
85 1. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
86 2. Enter the name of the Custom Switcher (20 characters max, alphanumeric) to the 'Add Custom Switcher'. Push the button 'Add'.
87 3. Configure settings. Select Theme by Theme option. Add UserAgent by UserAgent option.
88 4. Have fun!
89
90 = Setting and Using the PC Switcher =
91
92 There are three ways how to Using the PC Switcher.
93
94 = 1. Add a PC Switcher to the footer =
95
96 1. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
97 2. Configure settings. Check the checkbox 'Add a PC Switcher to the footer.' by PC Switcher option.
98 3. Have fun!
99
100 = 2. Add a PC Switcher to your sidebars/widget areas =
101
102 1. Add-on the widget 'PC Switcher', when you activate the plugin "Multi Device Switcher".
103 2. Go to the "Widgets" options page through the 'Appearance' menu in WordPress.
104 3. Drag and drop the title bars 'PC Switcher' into the desired area.
105 4. Have fun!
106
107 = 3. For the theme authors and developers, add a PC Switcher to your theme. =
108
109 1. Add the following code into the PHP files, when you develop your theme.
110
111 `<?php if ( function_exists('multi_device_switcher_add_pc_switcher') ) { multi_device_switcher_add_pc_switcher(); } ?>`
112 2. Have fun!
113
114 = Using default CSS and customized CSS =
115
116 * Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
117 * Configure settings. Check the checkbox 'Add a default CSS.' by PC Switcher option. If you want to customize CSS, uncheck the checkbox.
118 * Have fun!
119
120
121 You can design the PC Switcher in the Style Sheet.
122
123 **HTML output of the PC Switcher**
124
125 `
126 <div class="pc-switcher"><span class="active">Mobile</span><a href="http://DOMEIN/PATH/TO/?pc-switcher=1">PC</a></div>
127 `
128
129 **HTML output of the PC Switcher when switched**
130
131 `
132 <div class="pc-switcher"><a href="http://DOMEIN/PATH/TO/?pc-switcher=0">Mobile</a><span class="active">PC</span></div>
133 `
134
135 = How to use the Display Switcher Shortcode =
136
137 The **Display Switcher** Shortcode switch the content of the post or page through the detection of the device.
138
139 Add the shortcode `[multi]` in a post or page and use the `device` attribute to device name. if the device attribute is empty, detect the desktop PC.
140
141 = Attributes =
142
143 **device**
144
145 (string | empty) The name of the device
146
147 * smart
148 * tablet
149 * mobile
150 * game
151 * the name of the Custom Switcher
152
153 if empty, detect the desktop PC
154
155 = Example Shortcode =
156
157 `
158 [multi]pc or other specific stuff here[/multi]
159 [multi device="smart"]smartphone specific stuff here[/multi]
160 [multi device="tablet"]tablet specific stuff here[/multi]
161 [multi device="test"]test Custom Switcher specific stuff here[/multi]
162 `
163
164 For theme or plugin developers. Filters The Display Switcher Shortcode through hooks. In that case, edit theme or plugin files.
165
166 `
167 <?php
168 echo do_shortcode('[multi device="smart"]smartphone specific stuff here[/multi]');
169 ?>
170 `
171
172 = How to use the Disable Switcher =
173
174 The **Disable Switcher** disable the switching of the theme by a particular URL. If you match the access the url and a string or a regular expression (Regex mode), disable the switching of the theme. Regex mode is for advanced users.
175
176 1. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
177 2. Enter the path to the line by line where you want to disable by Disable Switcher option. Check the checkbox 'Enable Regex', if you want to use a regular expression.
178 3. Have fun!
179
180 = Example =
181
182 `
183 /sample-page
184 /2015/01/hello-world
185 `
186
187 = Regex mode (in the case of regular expression) =
188
189 `
190 \/sample\-
191 \/2015\/01
192 `
193
194 = UserAgent option Samples =
195
196 * [Default UserAgent](https://github.com/thingsym/multi-device-switcher/wiki/Default-UserAgent)
197
198 = Detect the device by JavaScript =
199
200 Multi Device Switcher set the Cookie that holds the state of the switch. You can get the Cookie and detect the device by JavaScript.
201
202 = Cookies =
203
204 * `multi-device-switcher` The name of the device is switched (value: null | device name)
205 * `disable-switcher` State of disabled (value: null | 1)
206 * `pc-switcher` State of the PC Switcher when switched (value: null | 1)
207
208 = Example =
209
210 `
211 <script src="http://DOMEIN/PATH/TO/jquery.cookie.js"></script>
212 <script>
213 (function($) {
214 $(function() {
215 if ( $.cookie( 'multi-device-switcher' ) == 'smart' ) {
216 /* smartphone specific stuff here */
217 } else if ( $.cookie( 'multi-device-switcher' ) == 'tablet' ) {
218 /* tablet specific stuff here */
219 } else {
220 /* pc or other specific stuff here */
221 }
222 });
223 })(jQuery);
224 </script>
225 `
226
227 = is_multi_device() function =
228
229 **is_multi_device()** function is a boolean function, meaning it returns either TRUE or FALSE. Works through the detection of the device by the Multi_Device_Switcher class.
230
231 = Usage =
232
233 `
234 <?php is_multi_device('smart'); ?>
235 `
236
237 = Example =
238
239 `
240 <?php
241 if ( function_exists( 'is_multi_device' ) ) {
242 if ( is_multi_device('smart') ) {
243 /* Display and echo smartphone specific stuff here */
244 } elseif ( is_multi_device('tablet') ) {
245 /* Display and echo tablet specific stuff here */
246 } else {
247 /* Display and echo pc or other specific stuff here */
248 }
249 }
250 ?>
251 `
252
253 = Parameters =
254
255 **device name** (required)
256
257 (string) The name of the device
258
259 * smart
260 * tablet
261 * mobile
262 * game
263 * the name of the Custom Switcher
264
265 = Return Values =
266
267 (boolean) Return boolean whether a particular device.
268
269 = is_pc_switcher() function =
270
271 **is_pc_switcher()** function is a boolean function, meaning it returns either TRUE or FALSE. Return the the state of PC Switcher by the Multi_Device_Switcher class. Return true if the theme has switched by the PC Switcher.
272
273 = Usage =
274
275 `
276 <?php is_pc_switcher(); ?>
277 `
278
279 = Example =
280
281 `
282 <?php
283 if ( function_exists( 'is_pc_switcher' ) ) {
284 if ( is_pc_switcher() ) {
285 /* Theme switched by the PC Switcher. Display and echo specific stuff here */
286 } else {
287 /* Display and echo specific stuff here */
288 }
289 }
290 ?>
291 `
292
293 = Parameters =
294
295 None
296
297 = Return Values =
298
299 (boolean) Return the state of PC Switcher.
300
301 = is_disable_switcher() function =
302
303 **is_disable_switcher()** function is a boolean function, meaning it returns either TRUE or FALSE. Return the state of disabled by the Multi_Device_Switcher class.
304
305 = Usage =
306
307 `
308 <?php is_disable_switcher(); ?>
309 `
310
311 = Example =
312
313 `
314 <?php
315 if ( function_exists( 'is_disable_switcher' ) ) {
316 if ( is_disable_switcher() ) {
317 /* Disabled. Display and echo specific stuff here */
318 } else {
319 /* Display and echo specific stuff here */
320 }
321 }
322 ?>
323 `
324
325 = Parameters =
326
327 None
328
329 = Return Values =
330
331 (boolean) Return the state of disabled.
332
333 = Multi Device Switcher Command =
334
335 The **Multi Device Switcher Command** is command-line tool.
336
337 Add-on the Multi Device Switcher Command, when you activate the plugin "Multi Device Switcher". To use the Multi Device Switcher Command is WP-CLI required.
338
339 = NAME =
340
341 `
342 wp multi-device
343 `
344
345 = DESCRIPTION =
346
347 `
348 Multi Device Switcher Command
349 `
350
351 = SYNOPSIS =
352
353 `
354 wp multi-device <command>
355 `
356
357 = SUBCOMMANDS =
358
359 `
360 add add Custom Switcher
361 css turn on/off default CSS
362 delete delete Custom Switcher
363 pc-switcher turn on/off PC Switcher
364 reset reset Settings to Default UserAgent
365 status get status of settings
366 theme get or switch a theme
367 useragent get or set UserAgent
368 `
369
370 For more information about the Multi Device Switcher Command, see `wp help multi-device <SUBCOMMANDS>`.
371
372 == Changelog ==
373
374 = 1.4.2 =
375 * edited: edit readme
376 * new features: Display Switcher Shortcode
377 * updated: update default UserAgent
378 * fixed: fix pc-switcher ssl url
379 = 1.4.1 =
380 * edited: edit readme
381 * new features: is_disable_switcher() function
382 * new features: is_pc_switcher() function
383 * fixed: fix redirect url and pc-switcher url
384 = 1.4.0 =
385 * edited: edit readme
386 * added: add cookies 'multi-device-switcher', 'disable-switcher'
387 * new features: Disable Switcher
388 * fixed: fix get_options_userAgent(), multi_device_switcher_get_options()
389 * fixed: add reserved words validate
390 * new features: Multi Device Switcher Command
391 * added: add option settings into Theme Customizer
392 * fixed: refactoring by the PHP_CodeSniffer
393 = 1.3.0 =
394 * fixed: fix script, style, html and readme
395 * new features: is_multi_device() function
396 * fixed: fix translation
397 * updated: update default UserAgent
398 * fixed: replace WP_PLUGIN_URL with plugins_url()
399 * fixed: using Page Hook Suffix
400 * merged: pull request [#3](https://github.com/thingsym/multi-device-switcher/pull/3)
401 = 1.2.3 =
402 * fixed: fix redirect uri with query string, using add_query_arg
403 * fixed: fix translation
404 * fixed: fix readme
405 = 1.2.2 =
406 * improved: improve responsiveness UI
407 * fixed: fix html
408 = 1.2.1 =
409 * fixed: delete add_contextual_help
410 * fixed: fix readme and html
411 = 1.2.0 =
412 * added: add PC Switcher Widget
413 * new features: PC Switcher
414 * added: add the settings link to the plugin page
415 = 1.1.2 =
416 * required: at least version 3.4
417 * fixed: fix tabs and buttons
418 = 1.1.1 =
419 * fixed: change the order of the UserAgent detection
420 * updated: update default UserAgent
421 * added: add HTTP/1.1 Vary header
422 = 1.1.0 =
423 * new features: Custom Switcher
424 = 1.0.4 =
425 * fixed: fix the object model PHP5, __construct() to replace Multi_Device_Switcher
426 * fixed: wp_get_themes(), and wp_get_theme() to replace get_themes(), get_theme()
427 = 1.0.3 =
428 * updated: update screenshots
429 * fixed: fix reset button
430 = 1.0.2 =
431 * added: add file uninstall.php
432 * fixed: split admin_enqueue_scripts() into two functions
433 * fixed: detects is_admin()
434 = 1.0.1 =
435 * fixed: split multi_device_switcher_init() into two functions
436 = 1.0.0 =
437 * Initial release.
438
439 == Upgrade Notice ==
440
441 = 1.1.2 =
442 * Requires at least version 3.4 of the Wordpress
443
444