PluginProbe
Multi Device Switcher / 1.4.0
Multi Device Switcher v1.4.0
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.0, at readme.txt

333 lines 10.1 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.1
9 Stable tag: 1.4.0
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 * Disable the switching of the theme for each url by the **Disable Switcher**.
28 * Can be using **is_multi_device()** function that detect of the device.
29 * **Multi Device Switcher Command** command-line tool (required WP-CLI)
30
31 = Contributing =
32
33 = Patches and Bug Fixes =
34
35 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.
36
37 = Contributors =
38
39 * hykw
40
41 = Translations =
42
43 Translating a plugin takes a lot of time, effort, and patience. I really appreciate the hard work from these contributors.
44
45 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.
46
47 = Translator =
48
49 * Japanese (ja) - <a href="http://global.thingslabo.com/blog/">Thingsym</a>
50
51 = The latest PO and MO files =
52
53 * [POT file](http://plugins.svn.wordpress.org/multi-device-switcher/trunk/languages/multi-device-switcher.pot)
54 * [PO files](http://plugins.svn.wordpress.org/multi-device-switcher/trunk/languages/)
55
56 = Send your own language pack =
57
58 You can send your own language pack to author.
59
60 * [multi-device-switcher - GitHub](https://github.com/thingsym/multi-device-switcher)
61 * [http://global.thingslabo.com/blog/ (en)](http://global.thingslabo.com/blog/)
62 * [http://blog.thingslabo.com (ja)](http://blog.thingslabo.com)
63
64 == Screenshots ==
65
66 1. Theme option
67 2. UserAgent option
68 3. PC Switcher option
69 4. PC Switcher button
70 5. Disable Switcher
71
72 == Installation ==
73
74 1. Download and unzip files. Or install multi-device-switcher using the WordPress plugin installer. In that case, skip 2.
75 2. Upload "multi-device-switcher" to the "/wp-content/plugins/" directory.
76 3. Activate the plugin through the 'Plugins' menu in WordPress.
77 4. Upload a separate theme to the "/wp-content/themes/" directory.
78 5. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
79 6. Configure settings to your needs. Select Theme by Theme option. Add and fix UserAgent by UserAgent option if necessary.
80 7. Have fun!
81
82 = How to add the Custom Switcher =
83
84 1. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
85 2. Enter the name of the Custom Switcher (20 characters max, alphanumeric) to the 'Add Custom Switcher'. Push the button 'Add'.
86 3. Configure settings. Select Theme by Theme option. Add UserAgent by UserAgent option.
87 4. Have fun!
88
89 = Setting and Using the PC Switcher =
90
91 There are three ways how to Using the PC Switcher.
92
93 = 1. Add a PC Switcher to the footer =
94
95 1. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
96 2. Configure settings. Check the checkbox 'Add a PC Switcher to the footer.' by PC Switcher option.
97 3. Have fun!
98
99 = 2. Add a PC Switcher to your sidebars/widget areas =
100
101 1. Add-on the widget 'PC Switcher', when you activate the plugin "Multi Device Switcher".
102 2. Go to the "Widgets" options page through the 'Appearance' menu in WordPress.
103 3. Drag and drop the title bars 'PC Switcher' into the desired area.
104 4. Have fun!
105
106 = 3. For the theme authors and developers, add a PC Switcher to your theme. =
107
108 1. Add the following code into the PHP files, when you develop your theme.
109
110 `<?php if ( function_exists('multi_device_switcher_add_pc_switcher') ) { multi_device_switcher_add_pc_switcher(); } ?>`
111 2. Have fun!
112
113 = Using default CSS and customized CSS =
114
115 * Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
116 * Configure settings. Check the checkbox 'Add a default CSS.' by PC Switcher option. If you want to customize CSS, uncheck the checkbox.
117 * Have fun!
118
119
120 You can design the PC Switcher in the Style Sheet.
121
122 **HTML output of the PC Switcher**
123
124 `
125 <div class="pc-switcher"><span class="active">Mobile</span><a href="http://DOMEIN/PATH/TO/?pc-switcher=1">PC</a></div>
126 `
127
128 **HTML output of the PC Switcher when switched**
129
130 `
131 <div class="pc-switcher"><a href="http://DOMEIN/PATH/TO/?pc-switcher=0">Mobile</a><span class="active">PC</span></div>
132 `
133
134
135 = How to use the Disable Switcher =
136
137 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.
138
139 1. Go to the "Multi Device Switcher" options page through the 'Appearance' menu in WordPress.
140 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.
141 3. Have fun!
142
143 = Examples =
144
145 `
146 /sample-page
147 /2015/01/hello-world
148 `
149
150 ##### Regex mode (in the case of regular expression)
151
152 `
153 \/sample\-
154 \/2015\/01
155 `
156
157 = UserAgent option Samples =
158
159 * [Default UserAgent](https://github.com/thingsym/multi-device-switcher/wiki/Default-UserAgent)
160
161 = Detect the device by JavaScript =
162
163 Multi Device Switcher set the Cookie that holds the state of the switch. You can get the Cookie and detect the device by JavaScript.
164
165 = Cookie =
166
167 * `multi-device-switcher` The name of the device is switched (value: null | device name)
168 * `disable-switcher` State of disabled (value: null | 1)
169 * `pc-switcher` State of the PC Switcher when switched (value: null | 1)
170
171 = Examples =
172
173 `
174 <script src="http://DOMEIN/PATH/TO/jquery.cookie.js"></script>
175 <script>
176 (function($) {
177 $(function() {
178 if ( $.cookie( 'multi-device-switcher' ) == 'smart' ) {
179 /* smartphone specific stuff here */
180 } else if ( $.cookie( 'multi-device-switcher' ) == 'tablet' ) {
181 /* tablet specific stuff here */
182 } else {
183 /* pc or other stuff here */
184 }
185 });
186 })(jQuery);
187 </script>
188 `
189
190 = is_multi_device() function =
191
192 **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.
193
194 = Usage =
195
196 `
197 <?php is_multi_device('smart'); ?>
198 `
199
200 = Examples =
201
202 `
203 <?php
204 if ( function_exists( 'is_multi_device' ) ) {
205 if ( is_multi_device('smart') ) {
206 /* Display and echo smartphone specific stuff here */
207 } elseif ( is_multi_device('tablet') ) {
208 /* Display and echo tablet specific stuff here */
209 } else {
210 /* Display and echo pc or other stuff here */
211 }
212 }
213 ?>
214 `
215
216 = Parameters =
217
218 **device name** (required)
219
220 (string) The name of the device
221
222 * smart
223 * tablet
224 * mobile
225 * game
226 * the name of the Custom Switcher
227
228 = Return Values =
229
230 (boolean) Return boolean whether a particular device.
231
232 = Multi Device Switcher Command =
233
234 The **Multi Device Switcher Command** is command-line tool.
235
236 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.
237
238 = NAME =
239
240 `
241 wp multi-device
242 `
243
244 = DESCRIPTION =
245
246 `
247 Multi Device Switcher Command
248 `
249
250 = SYNOPSIS =
251
252 `
253 wp multi-device <command>
254 `
255
256 = SUBCOMMANDS =
257
258 `
259 add add Custom Switcher
260 css turn on/off default CSS
261 delete delete Custom Switcher
262 pc-switcher turn on/off PC Switcher
263 reset reset Settings to Default UserAgent
264 status get status of settings
265 theme get or switch a theme
266 useragent get or set UserAgent
267 `
268
269 For more information about the Multi Device Switcher Command, see `wp help multi-device <SUBCOMMANDS>`.
270
271 == Changelog ==
272
273 = 1.4.0 =
274 * edited: edit readme
275 * added: add cookies 'multi-device-switcher', 'disable-switcher'
276 * new features: Disable Switcher
277 * fixed: fix get_options_userAgent(), multi_device_switcher_get_options()
278 * fixed: add reserved words validate
279 * new features: Multi Device Switcher Command
280 * added: add option settings into Theme Customizer
281 * fixed: refactoring by the PHP_CodeSniffer
282 = 1.3.0 =
283 * fixed: fix script, style, html and readme
284 * new features: is_multi_device() function
285 * fixed: fix translation
286 * updated: update default UserAgent
287 * fixed: replace WP_PLUGIN_URL with plugins_url()
288 * fixed: using Page Hook Suffix
289 * merged: pull request [#3](https://github.com/thingsym/multi-device-switcher/pull/3)
290 = 1.2.3 =
291 * fixed: fix redirect uri with query string, using add_query_arg
292 * fixed: fix translation
293 * fixed: fix readme
294 = 1.2.2 =
295 * improved: improve responsiveness UI
296 * fixed: fix html
297 = 1.2.1 =
298 * fixed: delete add_contextual_help
299 * fixed: fix readme and html
300 = 1.2.0 =
301 * added: add PC Switcher Widget
302 * new features: PC Switcher
303 * added: add the settings link to the plugin page
304 = 1.1.2 =
305 * required: at least version 3.4
306 * fixed: fix tabs and buttons
307 = 1.1.1 =
308 * fixed: change the order of the UserAgent detection
309 * updated: update default UserAgent
310 * added: add HTTP/1.1 Vary header
311 = 1.1.0 =
312 * new features: Custom Switcher
313 = 1.0.4 =
314 * fixed: fix the object model PHP5, __construct() to replace Multi_Device_Switcher
315 * fixed: wp_get_themes(), and wp_get_theme() to replace get_themes(), get_theme()
316 = 1.0.3 =
317 * updated: update screenshots
318 * fixed: fix reset button
319 = 1.0.2 =
320 * added: add file uninstall.php
321 * fixed: split admin_enqueue_scripts() into two functions
322 * fixed: detects is_admin()
323 = 1.0.1 =
324 * fixed: split multi_device_switcher_init() into two functions
325 = 1.0.0 =
326 * Initial release.
327
328 == Upgrade Notice ==
329
330 = 1.1.2 =
331 * Requires at least version 3.4 of the Wordpress
332
333