Version Description
- update japanese translation
- update pot
- imporve code with phpcs
- update wordpress-test-matrix
- fix test case
- fix plugin_metadata_links method
- add load_plugin_data method
- rename variable from options to option_name
- add test case for customizer
- rename method name
- update composer dependencies
- change from protected variable to public variable for unit test
- add timeout-minutes to workflows
- add phpunit-polyfills
- update install-wp-tests.sh
- tested up to 5.8.0
- fix .editorconfig
Download this release
Release Info
Developer | thingsym |
Plugin | Multi Device Switcher |
Version | 1.8.1 |
Comparing to | |
See all releases |
Code changes from version 1.8.0 to 1.8.1
- languages/multi-device-switcher-ja.mo +0 -0
- languages/multi-device-switcher-ja.po +76 -92
- languages/multi-device-switcher.pot +73 -91
- multi-device-switcher.php +89 -35
- pc-switcher-widget.php +3 -1
- readme.txt +20 -1
- wp-cli.php +23 -23
languages/multi-device-switcher-ja.mo
CHANGED
Binary file
|
languages/multi-device-switcher-ja.po
CHANGED
@@ -1,198 +1,182 @@
|
|
1 |
-
# Copyright (C) 2021
|
2 |
-
# This file is distributed under the same license as the Multi Device Switcher
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Multi Device Switcher 1.8.
|
6 |
-
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/multi-device-
|
7 |
-
"
|
8 |
-
"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
"
|
15 |
-
"X-Domain: multi-device-switcher\n"
|
16 |
-
|
17 |
-
#. Plugin Name of the plugin
|
18 |
-
#: multi-device-switcher.php:729
|
19 |
-
#: multi-device-switcher.php:730
|
20 |
-
#: multi-device-switcher.php:890
|
21 |
-
#: multi-device-switcher.php:1340
|
22 |
-
msgid "Multi Device Switcher"
|
23 |
-
msgstr "マルチデバイス"
|
24 |
-
|
25 |
-
#. Plugin URI of the plugin
|
26 |
-
msgid "https://github.com/thingsym/multi-device-switcher"
|
27 |
-
msgstr "https://github.com/thingsym/multi-device-switcher"
|
28 |
-
|
29 |
-
#. Description of the plugin
|
30 |
-
msgid "This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game and custom)."
|
31 |
-
msgstr "デバイスごとに個別のテーマを設定して自動的にテーマが切り替わります。 (スマートフォン、タブレット端末、携帯モバイル、ゲーム、カスタム設定に対応)"
|
32 |
-
|
33 |
-
#. Author of the plugin
|
34 |
-
msgid "thingsym"
|
35 |
-
msgstr "thingsym"
|
36 |
-
|
37 |
-
#. Author URI of the plugin
|
38 |
-
msgid "https://www.thingslabo.com/"
|
39 |
-
msgstr "https://www.thingslabo.com/"
|
40 |
|
41 |
-
#: multi-device-switcher.php:
|
42 |
-
#: multi-device-switcher.php:518
|
43 |
msgid "Mobile"
|
44 |
msgstr "モバイル"
|
45 |
|
46 |
-
#: multi-device-switcher.php:
|
47 |
-
#: multi-device-switcher.php:518
|
48 |
msgid "PC"
|
49 |
msgstr "PC"
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
msgid "Settings"
|
53 |
msgstr "設定"
|
54 |
|
55 |
-
#: multi-device-switcher.php:
|
56 |
-
msgid "Become a sponsor
|
57 |
-
msgstr "スポンサーになる
|
58 |
|
59 |
-
#: multi-device-switcher.php:
|
60 |
msgid "Theme"
|
61 |
msgstr "テーマ"
|
62 |
|
63 |
-
#: multi-device-switcher.php:
|
64 |
-
#: multi-device-switcher.php:1331
|
65 |
msgid "Smart Phone Theme"
|
66 |
msgstr "スマートフォン用テーマ"
|
67 |
|
68 |
-
#: multi-device-switcher.php:
|
69 |
-
#: multi-device-switcher.php:
|
70 |
-
#: multi-device-switcher.php:
|
71 |
-
#: multi-device-switcher.php:
|
72 |
-
#: multi-device-switcher.php:
|
73 |
-
#: multi-device-switcher.php:
|
74 |
-
#: multi-device-switcher.php:1019
|
75 |
-
#: multi-device-switcher.php:1022
|
76 |
-
#: multi-device-switcher.php:1065
|
77 |
-
#: multi-device-switcher.php:1068
|
78 |
-
#: multi-device-switcher.php:1321
|
79 |
-
#: multi-device-switcher.php:1376
|
80 |
msgid "None"
|
81 |
msgstr "なし"
|
82 |
|
83 |
-
#: multi-device-switcher.php:
|
84 |
-
#: multi-device-switcher.php:1332
|
85 |
msgid "Tablet PC Theme"
|
86 |
msgstr "タブレット端末用テーマ"
|
87 |
|
88 |
-
#: multi-device-switcher.php:
|
89 |
-
#: multi-device-switcher.php:1333
|
90 |
msgid "Mobile Phone Theme"
|
91 |
msgstr "携帯モバイル端末用テーマ"
|
92 |
|
93 |
-
#: multi-device-switcher.php:
|
94 |
-
#: multi-device-switcher.php:1334
|
95 |
msgid "Game Platforms Theme"
|
96 |
msgstr "ゲームプラットフォーム用テーマ"
|
97 |
|
98 |
-
#: multi-device-switcher.php:
|
99 |
msgid "Custom Switcher Theme"
|
100 |
msgstr "Custom Switcher用テーマ"
|
101 |
|
102 |
-
#: multi-device-switcher.php:
|
103 |
msgid "Delete"
|
104 |
msgstr "削除"
|
105 |
|
106 |
-
#: multi-device-switcher.php:
|
107 |
msgid "Are you sure you want to delete %1$s ?"
|
108 |
msgstr "%1$s を削除してよろしいですか?"
|
109 |
|
110 |
-
#: multi-device-switcher.php:
|
111 |
-
#: multi-device-switcher.php:1096
|
112 |
msgid "Add Custom Switcher"
|
113 |
msgstr "Custom Switcher を追加"
|
114 |
|
115 |
-
#: multi-device-switcher.php:
|
116 |
msgid "Add"
|
117 |
msgstr "追加"
|
118 |
|
119 |
-
#: multi-device-switcher.php:
|
120 |
msgid "20 characters max, alphanumeric"
|
121 |
msgstr "半角英数字 20 文字以内"
|
122 |
|
123 |
-
#: multi-device-switcher.php:
|
124 |
msgid "UserAgent"
|
125 |
msgstr "ユーザーエージェント"
|
126 |
|
127 |
-
#: multi-device-switcher.php:
|
128 |
msgid "Enter Comma-separated values (csv) format."
|
129 |
msgstr "csv 形式で入力してください。"
|
130 |
|
131 |
-
#: multi-device-switcher.php:
|
132 |
msgid "Smart Phone"
|
133 |
msgstr "スマートフォン"
|
134 |
|
135 |
-
#: multi-device-switcher.php:
|
136 |
msgid "Tablet PC"
|
137 |
msgstr "タブレット端末"
|
138 |
|
139 |
-
#: multi-device-switcher.php:
|
140 |
msgid "Mobile Phone"
|
141 |
msgstr "携帯モバイル端末"
|
142 |
|
143 |
-
#: multi-device-switcher.php:
|
144 |
msgid "Game Platforms"
|
145 |
msgstr "ゲームプラットフォーム"
|
146 |
|
147 |
-
#: multi-device-switcher.php:
|
148 |
msgid "Reset Settings to Default UserAgent"
|
149 |
msgstr "ユーザーエージェントをデフォルトにもどす"
|
150 |
|
151 |
-
#: multi-device-switcher.php:
|
152 |
msgid "Custom Switcher UserAgent"
|
153 |
msgstr "Custom Switcher用ユーザーエージェント"
|
154 |
|
155 |
-
#: multi-device-switcher.php:
|
156 |
-
#: pc-switcher-widget.php:57
|
157 |
msgid "PC Switcher"
|
158 |
msgstr "PC Switcher"
|
159 |
|
160 |
-
#: multi-device-switcher.php:
|
161 |
-
#: multi-device-switcher.php:1156
|
162 |
msgid "Add PC Switcher"
|
163 |
msgstr "PC Switcher を追加"
|
164 |
|
165 |
-
#: multi-device-switcher.php:
|
166 |
msgid "Add a PC Switcher to the footer."
|
167 |
msgstr "PC Switcher をフッターに追加する"
|
168 |
|
169 |
-
#: multi-device-switcher.php:
|
170 |
-
#: multi-device-switcher.php:1162
|
171 |
msgid "Add default CSS"
|
172 |
msgstr "デフォルトCSSを追加"
|
173 |
|
174 |
-
#: multi-device-switcher.php:
|
175 |
msgid "Add a default CSS."
|
176 |
msgstr "デフォルトCSSを追加"
|
177 |
|
178 |
-
#: multi-device-switcher.php:
|
179 |
msgid "Disable Switcher"
|
180 |
msgstr "切り替え無効"
|
181 |
|
182 |
-
#: multi-device-switcher.php:
|
183 |
-
#: multi-device-switcher.php:1175
|
184 |
msgid "Path"
|
185 |
msgstr "パス"
|
186 |
|
187 |
-
#: multi-device-switcher.php:
|
188 |
-
#: multi-device-switcher.php:1182
|
189 |
msgid "Regex mode"
|
190 |
msgstr "正規表現モード"
|
191 |
|
192 |
-
#: multi-device-switcher.php:
|
193 |
msgid "Enable Regex"
|
194 |
msgstr "正規表現を有効化"
|
195 |
|
196 |
#: pc-switcher-widget.php:54
|
197 |
msgid "Add the PC Switcher to a widget."
|
198 |
msgstr "PC Switcher をウィジェットに追加"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2021 Multi Device Switcher
|
2 |
+
# This file is distributed under the same license as the Multi Device Switcher package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Multi Device Switcher 1.8.1\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/multi-device-"
|
7 |
+
"switcher\n"
|
8 |
+
"POT-Creation-Date: 2021-12-26 08:37:47+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
|
13 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
#: multi-device-switcher.php:532 multi-device-switcher.php:538
|
|
|
17 |
msgid "Mobile"
|
18 |
msgstr "モバイル"
|
19 |
|
20 |
+
#: multi-device-switcher.php:532 multi-device-switcher.php:538
|
|
|
21 |
msgid "PC"
|
22 |
msgstr "PC"
|
23 |
|
24 |
+
#. #-#-#-#-# multi-device-switcher.pot (Multi Device Switcher 1.8.1) #-#-#-#-#
|
25 |
+
#. Plugin Name of the plugin/theme
|
26 |
+
#: multi-device-switcher.php:755 multi-device-switcher.php:756
|
27 |
+
#: multi-device-switcher.php:939 multi-device-switcher.php:1394
|
28 |
+
msgid "Multi Device Switcher"
|
29 |
+
msgstr "Multi Device Switcher"
|
30 |
+
|
31 |
+
#: multi-device-switcher.php:801
|
32 |
msgid "Settings"
|
33 |
msgstr "設定"
|
34 |
|
35 |
+
#: multi-device-switcher.php:826
|
36 |
+
msgid "Become a sponsor"
|
37 |
+
msgstr "スポンサーになる"
|
38 |
|
39 |
+
#: multi-device-switcher.php:961
|
40 |
msgid "Theme"
|
41 |
msgstr "テーマ"
|
42 |
|
43 |
+
#: multi-device-switcher.php:963 multi-device-switcher.php:1385
|
|
|
44 |
msgid "Smart Phone Theme"
|
45 |
msgstr "スマートフォン用テーマ"
|
46 |
|
47 |
+
#: multi-device-switcher.php:972 multi-device-switcher.php:975
|
48 |
+
#: multi-device-switcher.php:1005 multi-device-switcher.php:1008
|
49 |
+
#: multi-device-switcher.php:1038 multi-device-switcher.php:1041
|
50 |
+
#: multi-device-switcher.php:1071 multi-device-switcher.php:1074
|
51 |
+
#: multi-device-switcher.php:1118 multi-device-switcher.php:1121
|
52 |
+
#: multi-device-switcher.php:1375 multi-device-switcher.php:1430
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
msgid "None"
|
54 |
msgstr "なし"
|
55 |
|
56 |
+
#: multi-device-switcher.php:997 multi-device-switcher.php:1386
|
|
|
57 |
msgid "Tablet PC Theme"
|
58 |
msgstr "タブレット端末用テーマ"
|
59 |
|
60 |
+
#: multi-device-switcher.php:1030 multi-device-switcher.php:1387
|
|
|
61 |
msgid "Mobile Phone Theme"
|
62 |
msgstr "携帯モバイル端末用テーマ"
|
63 |
|
64 |
+
#: multi-device-switcher.php:1063 multi-device-switcher.php:1388
|
|
|
65 |
msgid "Game Platforms Theme"
|
66 |
msgstr "ゲームプラットフォーム用テーマ"
|
67 |
|
68 |
+
#: multi-device-switcher.php:1098
|
69 |
msgid "Custom Switcher Theme"
|
70 |
msgstr "Custom Switcher用テーマ"
|
71 |
|
72 |
+
#: multi-device-switcher.php:1136
|
73 |
msgid "Delete"
|
74 |
msgstr "削除"
|
75 |
|
76 |
+
#: multi-device-switcher.php:1136
|
77 |
msgid "Are you sure you want to delete %1$s ?"
|
78 |
msgstr "%1$s を削除してよろしいですか?"
|
79 |
|
80 |
+
#: multi-device-switcher.php:1148 multi-device-switcher.php:1150
|
|
|
81 |
msgid "Add Custom Switcher"
|
82 |
msgstr "Custom Switcher を追加"
|
83 |
|
84 |
+
#: multi-device-switcher.php:1152
|
85 |
msgid "Add"
|
86 |
msgstr "追加"
|
87 |
|
88 |
+
#: multi-device-switcher.php:1153
|
89 |
msgid "20 characters max, alphanumeric"
|
90 |
msgstr "半角英数字 20 文字以内"
|
91 |
|
92 |
+
#: multi-device-switcher.php:1161
|
93 |
msgid "UserAgent"
|
94 |
msgstr "ユーザーエージェント"
|
95 |
|
96 |
+
#: multi-device-switcher.php:1162
|
97 |
msgid "Enter Comma-separated values (csv) format."
|
98 |
msgstr "csv 形式で入力してください。"
|
99 |
|
100 |
+
#: multi-device-switcher.php:1165
|
101 |
msgid "Smart Phone"
|
102 |
msgstr "スマートフォン"
|
103 |
|
104 |
+
#: multi-device-switcher.php:1168
|
105 |
msgid "Tablet PC"
|
106 |
msgstr "タブレット端末"
|
107 |
|
108 |
+
#: multi-device-switcher.php:1171
|
109 |
msgid "Mobile Phone"
|
110 |
msgstr "携帯モバイル端末"
|
111 |
|
112 |
+
#: multi-device-switcher.php:1174
|
113 |
msgid "Game Platforms"
|
114 |
msgstr "ゲームプラットフォーム"
|
115 |
|
116 |
+
#: multi-device-switcher.php:1178
|
117 |
msgid "Reset Settings to Default UserAgent"
|
118 |
msgstr "ユーザーエージェントをデフォルトにもどす"
|
119 |
|
120 |
+
#: multi-device-switcher.php:1183
|
121 |
msgid "Custom Switcher UserAgent"
|
122 |
msgstr "Custom Switcher用ユーザーエージェント"
|
123 |
|
124 |
+
#: multi-device-switcher.php:1205 pc-switcher-widget.php:57
|
|
|
125 |
msgid "PC Switcher"
|
126 |
msgstr "PC Switcher"
|
127 |
|
128 |
+
#: multi-device-switcher.php:1208 multi-device-switcher.php:1210
|
|
|
129 |
msgid "Add PC Switcher"
|
130 |
msgstr "PC Switcher を追加"
|
131 |
|
132 |
+
#: multi-device-switcher.php:1211
|
133 |
msgid "Add a PC Switcher to the footer."
|
134 |
msgstr "PC Switcher をフッターに追加する"
|
135 |
|
136 |
+
#: multi-device-switcher.php:1214 multi-device-switcher.php:1216
|
|
|
137 |
msgid "Add default CSS"
|
138 |
msgstr "デフォルトCSSを追加"
|
139 |
|
140 |
+
#: multi-device-switcher.php:1217
|
141 |
msgid "Add a default CSS."
|
142 |
msgstr "デフォルトCSSを追加"
|
143 |
|
144 |
+
#: multi-device-switcher.php:1224
|
145 |
msgid "Disable Switcher"
|
146 |
msgstr "切り替え無効"
|
147 |
|
148 |
+
#: multi-device-switcher.php:1227 multi-device-switcher.php:1229
|
|
|
149 |
msgid "Path"
|
150 |
msgstr "パス"
|
151 |
|
152 |
+
#: multi-device-switcher.php:1234 multi-device-switcher.php:1236
|
|
|
153 |
msgid "Regex mode"
|
154 |
msgstr "正規表現モード"
|
155 |
|
156 |
+
#: multi-device-switcher.php:1237
|
157 |
msgid "Enable Regex"
|
158 |
msgstr "正規表現を有効化"
|
159 |
|
160 |
#: pc-switcher-widget.php:54
|
161 |
msgid "Add the PC Switcher to a widget."
|
162 |
msgstr "PC Switcher をウィジェットに追加"
|
163 |
+
|
164 |
+
#. Plugin URI of the plugin/theme
|
165 |
+
msgid "https://github.com/thingsym/multi-device-switcher"
|
166 |
+
msgstr "https://github.com/thingsym/multi-device-switcher"
|
167 |
+
|
168 |
+
#. Description of the plugin/theme
|
169 |
+
msgid ""
|
170 |
+
"This WordPress plugin allows you to set a separate theme for device (Smart "
|
171 |
+
"Phone, Tablet PC, Mobile Phone, Game and custom)."
|
172 |
+
msgstr ""
|
173 |
+
"This WordPress plugin allows you to set a separate theme for device (Smart "
|
174 |
+
"Phone, Tablet PC, Mobile Phone, Game and custom)."
|
175 |
+
|
176 |
+
#. Author of the plugin/theme
|
177 |
+
msgid "thingsym"
|
178 |
+
msgstr "thingsym"
|
179 |
+
|
180 |
+
#. Author URI of the plugin/theme
|
181 |
+
msgid "https://www.thingslabo.com/"
|
182 |
+
msgstr "https://www.thingslabo.com/"
|
languages/multi-device-switcher.pot
CHANGED
@@ -1,198 +1,180 @@
|
|
1 |
-
# Copyright (C) 2021
|
2 |
-
# This file is distributed under the same license as the Multi Device Switcher
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Multi Device Switcher 1.8.
|
6 |
-
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/multi-device-
|
7 |
-
"
|
8 |
-
"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
"
|
15 |
-
"X-Domain: multi-device-switcher\n"
|
16 |
-
|
17 |
-
#. Plugin Name of the plugin
|
18 |
-
#: multi-device-switcher.php:729
|
19 |
-
#: multi-device-switcher.php:730
|
20 |
-
#: multi-device-switcher.php:890
|
21 |
-
#: multi-device-switcher.php:1340
|
22 |
-
msgid "Multi Device Switcher"
|
23 |
-
msgstr ""
|
24 |
-
|
25 |
-
#. Plugin URI of the plugin
|
26 |
-
msgid "https://github.com/thingsym/multi-device-switcher"
|
27 |
-
msgstr ""
|
28 |
-
|
29 |
-
#. Description of the plugin
|
30 |
-
msgid "This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game and custom)."
|
31 |
-
msgstr ""
|
32 |
-
|
33 |
-
#. Author of the plugin
|
34 |
-
msgid "thingsym"
|
35 |
-
msgstr ""
|
36 |
-
|
37 |
-
#. Author URI of the plugin
|
38 |
-
msgid "https://www.thingslabo.com/"
|
39 |
-
msgstr ""
|
40 |
|
41 |
-
#: multi-device-switcher.php:
|
42 |
-
#: multi-device-switcher.php:518
|
43 |
msgid "Mobile"
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: multi-device-switcher.php:
|
47 |
-
#: multi-device-switcher.php:518
|
48 |
msgid "PC"
|
49 |
msgstr ""
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
msgid "Settings"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: multi-device-switcher.php:
|
56 |
-
msgid "Become a sponsor
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: multi-device-switcher.php:
|
60 |
msgid "Theme"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: multi-device-switcher.php:
|
64 |
-
#: multi-device-switcher.php:1331
|
65 |
msgid "Smart Phone Theme"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: multi-device-switcher.php:
|
69 |
-
#: multi-device-switcher.php:
|
70 |
-
#: multi-device-switcher.php:
|
71 |
-
#: multi-device-switcher.php:
|
72 |
-
#: multi-device-switcher.php:
|
73 |
-
#: multi-device-switcher.php:
|
74 |
-
#: multi-device-switcher.php:1019
|
75 |
-
#: multi-device-switcher.php:1022
|
76 |
-
#: multi-device-switcher.php:1065
|
77 |
-
#: multi-device-switcher.php:1068
|
78 |
-
#: multi-device-switcher.php:1321
|
79 |
-
#: multi-device-switcher.php:1376
|
80 |
msgid "None"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: multi-device-switcher.php:
|
84 |
-
#: multi-device-switcher.php:1332
|
85 |
msgid "Tablet PC Theme"
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: multi-device-switcher.php:
|
89 |
-
#: multi-device-switcher.php:1333
|
90 |
msgid "Mobile Phone Theme"
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: multi-device-switcher.php:
|
94 |
-
#: multi-device-switcher.php:1334
|
95 |
msgid "Game Platforms Theme"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: multi-device-switcher.php:
|
99 |
msgid "Custom Switcher Theme"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: multi-device-switcher.php:
|
103 |
msgid "Delete"
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: multi-device-switcher.php:
|
107 |
msgid "Are you sure you want to delete %1$s ?"
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: multi-device-switcher.php:
|
111 |
-
#: multi-device-switcher.php:1096
|
112 |
msgid "Add Custom Switcher"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: multi-device-switcher.php:
|
116 |
msgid "Add"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: multi-device-switcher.php:
|
120 |
msgid "20 characters max, alphanumeric"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: multi-device-switcher.php:
|
124 |
msgid "UserAgent"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: multi-device-switcher.php:
|
128 |
msgid "Enter Comma-separated values (csv) format."
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: multi-device-switcher.php:
|
132 |
msgid "Smart Phone"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: multi-device-switcher.php:
|
136 |
msgid "Tablet PC"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: multi-device-switcher.php:
|
140 |
msgid "Mobile Phone"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: multi-device-switcher.php:
|
144 |
msgid "Game Platforms"
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: multi-device-switcher.php:
|
148 |
msgid "Reset Settings to Default UserAgent"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: multi-device-switcher.php:
|
152 |
msgid "Custom Switcher UserAgent"
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: multi-device-switcher.php:
|
156 |
-
#: pc-switcher-widget.php:57
|
157 |
msgid "PC Switcher"
|
158 |
msgstr ""
|
159 |
|
160 |
-
#: multi-device-switcher.php:
|
161 |
-
#: multi-device-switcher.php:1156
|
162 |
msgid "Add PC Switcher"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: multi-device-switcher.php:
|
166 |
msgid "Add a PC Switcher to the footer."
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: multi-device-switcher.php:
|
170 |
-
#: multi-device-switcher.php:1162
|
171 |
msgid "Add default CSS"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: multi-device-switcher.php:
|
175 |
msgid "Add a default CSS."
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: multi-device-switcher.php:
|
179 |
msgid "Disable Switcher"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: multi-device-switcher.php:
|
183 |
-
#: multi-device-switcher.php:1175
|
184 |
msgid "Path"
|
185 |
msgstr ""
|
186 |
|
187 |
-
#: multi-device-switcher.php:
|
188 |
-
#: multi-device-switcher.php:1182
|
189 |
msgid "Regex mode"
|
190 |
msgstr ""
|
191 |
|
192 |
-
#: multi-device-switcher.php:
|
193 |
msgid "Enable Regex"
|
194 |
msgstr ""
|
195 |
|
196 |
#: pc-switcher-widget.php:54
|
197 |
msgid "Add the PC Switcher to a widget."
|
198 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2021 Multi Device Switcher
|
2 |
+
# This file is distributed under the same license as the Multi Device Switcher package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Multi Device Switcher 1.8.1\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/multi-device-"
|
7 |
+
"switcher\n"
|
8 |
+
"POT-Creation-Date: 2021-12-26 08:37:47+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
|
13 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
#: multi-device-switcher.php:532 multi-device-switcher.php:538
|
|
|
17 |
msgid "Mobile"
|
18 |
msgstr ""
|
19 |
|
20 |
+
#: multi-device-switcher.php:532 multi-device-switcher.php:538
|
|
|
21 |
msgid "PC"
|
22 |
msgstr ""
|
23 |
|
24 |
+
#. #-#-#-#-# multi-device-switcher.pot (Multi Device Switcher 1.8.1) #-#-#-#-#
|
25 |
+
#. Plugin Name of the plugin/theme
|
26 |
+
#: multi-device-switcher.php:755 multi-device-switcher.php:756
|
27 |
+
#: multi-device-switcher.php:939 multi-device-switcher.php:1394
|
28 |
+
msgid "Multi Device Switcher"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: multi-device-switcher.php:801
|
32 |
msgid "Settings"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: multi-device-switcher.php:826
|
36 |
+
msgid "Become a sponsor"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: multi-device-switcher.php:961
|
40 |
msgid "Theme"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: multi-device-switcher.php:963 multi-device-switcher.php:1385
|
|
|
44 |
msgid "Smart Phone Theme"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: multi-device-switcher.php:972 multi-device-switcher.php:975
|
48 |
+
#: multi-device-switcher.php:1005 multi-device-switcher.php:1008
|
49 |
+
#: multi-device-switcher.php:1038 multi-device-switcher.php:1041
|
50 |
+
#: multi-device-switcher.php:1071 multi-device-switcher.php:1074
|
51 |
+
#: multi-device-switcher.php:1118 multi-device-switcher.php:1121
|
52 |
+
#: multi-device-switcher.php:1375 multi-device-switcher.php:1430
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
msgid "None"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: multi-device-switcher.php:997 multi-device-switcher.php:1386
|
|
|
57 |
msgid "Tablet PC Theme"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: multi-device-switcher.php:1030 multi-device-switcher.php:1387
|
|
|
61 |
msgid "Mobile Phone Theme"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: multi-device-switcher.php:1063 multi-device-switcher.php:1388
|
|
|
65 |
msgid "Game Platforms Theme"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: multi-device-switcher.php:1098
|
69 |
msgid "Custom Switcher Theme"
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: multi-device-switcher.php:1136
|
73 |
msgid "Delete"
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: multi-device-switcher.php:1136
|
77 |
msgid "Are you sure you want to delete %1$s ?"
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: multi-device-switcher.php:1148 multi-device-switcher.php:1150
|
|
|
81 |
msgid "Add Custom Switcher"
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: multi-device-switcher.php:1152
|
85 |
msgid "Add"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: multi-device-switcher.php:1153
|
89 |
msgid "20 characters max, alphanumeric"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: multi-device-switcher.php:1161
|
93 |
msgid "UserAgent"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: multi-device-switcher.php:1162
|
97 |
msgid "Enter Comma-separated values (csv) format."
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: multi-device-switcher.php:1165
|
101 |
msgid "Smart Phone"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: multi-device-switcher.php:1168
|
105 |
msgid "Tablet PC"
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: multi-device-switcher.php:1171
|
109 |
msgid "Mobile Phone"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: multi-device-switcher.php:1174
|
113 |
msgid "Game Platforms"
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: multi-device-switcher.php:1178
|
117 |
msgid "Reset Settings to Default UserAgent"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: multi-device-switcher.php:1183
|
121 |
msgid "Custom Switcher UserAgent"
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: multi-device-switcher.php:1205 pc-switcher-widget.php:57
|
|
|
125 |
msgid "PC Switcher"
|
126 |
msgstr ""
|
127 |
|
128 |
+
#: multi-device-switcher.php:1208 multi-device-switcher.php:1210
|
|
|
129 |
msgid "Add PC Switcher"
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: multi-device-switcher.php:1211
|
133 |
msgid "Add a PC Switcher to the footer."
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: multi-device-switcher.php:1214 multi-device-switcher.php:1216
|
|
|
137 |
msgid "Add default CSS"
|
138 |
msgstr ""
|
139 |
|
140 |
+
#: multi-device-switcher.php:1217
|
141 |
msgid "Add a default CSS."
|
142 |
msgstr ""
|
143 |
|
144 |
+
#: multi-device-switcher.php:1224
|
145 |
msgid "Disable Switcher"
|
146 |
msgstr ""
|
147 |
|
148 |
+
#: multi-device-switcher.php:1227 multi-device-switcher.php:1229
|
|
|
149 |
msgid "Path"
|
150 |
msgstr ""
|
151 |
|
152 |
+
#: multi-device-switcher.php:1234 multi-device-switcher.php:1236
|
|
|
153 |
msgid "Regex mode"
|
154 |
msgstr ""
|
155 |
|
156 |
+
#: multi-device-switcher.php:1237
|
157 |
msgid "Enable Regex"
|
158 |
msgstr ""
|
159 |
|
160 |
#: pc-switcher-widget.php:54
|
161 |
msgid "Add the PC Switcher to a widget."
|
162 |
msgstr ""
|
163 |
+
|
164 |
+
#. Plugin URI of the plugin/theme
|
165 |
+
msgid "https://github.com/thingsym/multi-device-switcher"
|
166 |
+
msgstr ""
|
167 |
+
|
168 |
+
#. Description of the plugin/theme
|
169 |
+
msgid ""
|
170 |
+
"This WordPress plugin allows you to set a separate theme for device (Smart "
|
171 |
+
"Phone, Tablet PC, Mobile Phone, Game and custom)."
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#. Author of the plugin/theme
|
175 |
+
msgid "thingsym"
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#. Author URI of the plugin/theme
|
179 |
+
msgid "https://www.thingslabo.com/"
|
180 |
+
msgstr ""
|
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 and custom).
|
6 |
-
* Version: 1.8.
|
7 |
* Author: thingsym
|
8 |
* Author URI: https://www.thingslabo.com/
|
9 |
* License: GPL2 or later
|
@@ -26,63 +26,63 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
26 |
class Multi_Device_Switcher {
|
27 |
|
28 |
/**
|
29 |
-
*
|
30 |
*
|
31 |
-
* @access
|
32 |
*
|
33 |
* @var string $option_group The group name of option
|
34 |
*/
|
35 |
-
|
36 |
|
37 |
/**
|
38 |
-
*
|
39 |
*
|
40 |
-
* @access
|
41 |
*
|
42 |
* @var string $option_name The option name
|
43 |
*/
|
44 |
-
|
45 |
|
46 |
/**
|
47 |
-
*
|
48 |
*
|
49 |
-
* @access
|
50 |
*
|
51 |
* @var string $capability The types of capability
|
52 |
*/
|
53 |
-
|
54 |
|
55 |
/**
|
56 |
-
*
|
57 |
*
|
58 |
-
* @access
|
59 |
*
|
60 |
* @var string $cookie_name_multi_device_switcher
|
61 |
*/
|
62 |
-
|
63 |
|
64 |
/**
|
65 |
-
*
|
66 |
*
|
67 |
-
* @access
|
68 |
*
|
69 |
* @var string $cookie_name_disable_switcher
|
70 |
*/
|
71 |
-
|
72 |
|
73 |
/**
|
74 |
-
*
|
75 |
*
|
76 |
-
* @access
|
77 |
*
|
78 |
* @var string $cookie_name_pc_switcher
|
79 |
*/
|
80 |
-
|
81 |
|
82 |
/**
|
83 |
-
*
|
84 |
*
|
85 |
-
* @access
|
86 |
*
|
87 |
* @var array $default_options {
|
88 |
* default options
|
@@ -103,7 +103,7 @@ class Multi_Device_Switcher {
|
|
103 |
*
|
104 |
* @since 1.7.0
|
105 |
*/
|
106 |
-
|
107 |
'pc_switcher' => 1,
|
108 |
'default_css' => 1,
|
109 |
'theme_smartphone' => 'None',
|
@@ -119,7 +119,7 @@ class Multi_Device_Switcher {
|
|
119 |
);
|
120 |
|
121 |
/**
|
122 |
-
* Public
|
123 |
*
|
124 |
* @access public
|
125 |
*
|
@@ -127,6 +127,15 @@ class Multi_Device_Switcher {
|
|
127 |
*/
|
128 |
public $device = '';
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
/**
|
131 |
* Constructor
|
132 |
*
|
@@ -135,6 +144,7 @@ class Multi_Device_Switcher {
|
|
135 |
* @since 1.0.0
|
136 |
*/
|
137 |
public function __construct() {
|
|
|
138 |
add_action( 'init', array( $this, 'load_textdomain' ) );
|
139 |
add_action( 'init', array( $this, 'init' ) );
|
140 |
|
@@ -146,7 +156,7 @@ class Multi_Device_Switcher {
|
|
146 |
|
147 |
add_action( 'admin_init', array( $this, 'register_settings' ) );
|
148 |
add_action( 'admin_menu', array( $this, 'add_option_page' ) );
|
149 |
-
add_action( 'customize_register', array( $this, '
|
150 |
add_action( 'plugins_loaded', array( $this, 'load_file' ) );
|
151 |
}
|
152 |
|
@@ -188,6 +198,7 @@ class Multi_Device_Switcher {
|
|
188 |
|
189 |
add_action( 'init', array( $this, 'session' ) );
|
190 |
|
|
|
191 |
$server_ua = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
|
192 |
$user_agent = $this->get_options_user_agent();
|
193 |
|
@@ -460,9 +471,13 @@ class Multi_Device_Switcher {
|
|
460 |
*/
|
461 |
public function session() {
|
462 |
if ( isset( $_GET['pc-switcher'] ) ) {
|
|
|
463 |
setcookie( $this->cookie_name_pc_switcher, $_GET['pc-switcher'] ? '1' : '', 0, '/', '', is_ssl(), false );
|
464 |
|
465 |
-
|
|
|
|
|
|
|
466 |
|
467 |
unset( $_GET['pc-switcher'] );
|
468 |
if ( ! empty( $_GET ) ) {
|
@@ -499,12 +514,17 @@ class Multi_Device_Switcher {
|
|
499 |
'pc-switcher-options',
|
500 |
plugins_url() . '/multi-device-switcher/pc-switcher.css',
|
501 |
array(),
|
502 |
-
'
|
|
|
503 |
);
|
504 |
}
|
505 |
|
506 |
$uri = is_ssl() ? 'https://' : 'http://';
|
507 |
-
|
|
|
|
|
|
|
|
|
508 |
|
509 |
if ( isset( $_COOKIE[ $this->cookie_name_pc_switcher ] ) ) {
|
510 |
$uri .= add_query_arg( 'pc-switcher', 0 );
|
@@ -571,15 +591,20 @@ class Multi_Device_Switcher {
|
|
571 |
$options = $this->get_options();
|
572 |
$disable_path = preg_split( '/\R/', $options['disable_path'], -1, PREG_SPLIT_NO_EMPTY );
|
573 |
|
|
|
|
|
|
|
|
|
|
|
574 |
foreach ( (array) $disable_path as $path ) {
|
575 |
if ( $options['enable_regex'] ) {
|
576 |
-
if ( preg_match( '/' . $path . '/i', $
|
577 |
$disable = true;
|
578 |
break;
|
579 |
}
|
580 |
}
|
581 |
else {
|
582 |
-
if ( preg_match( '/^' . preg_quote( (string) $path, '/' ) . '$/i', $
|
583 |
$disable = true;
|
584 |
break;
|
585 |
}
|
@@ -656,7 +681,7 @@ class Multi_Device_Switcher {
|
|
656 |
'multi-device-switcher-options',
|
657 |
plugins_url() . '/multi-device-switcher/multi-device-switcher.js',
|
658 |
array( 'jquery', 'jquery-ui-tabs' ),
|
659 |
-
'
|
660 |
);
|
661 |
}
|
662 |
|
@@ -674,7 +699,8 @@ class Multi_Device_Switcher {
|
|
674 |
'multi-device-switcher-options',
|
675 |
plugins_url() . '/multi-device-switcher/multi-device-switcher.css',
|
676 |
array(),
|
677 |
-
'
|
|
|
678 |
);
|
679 |
}
|
680 |
|
@@ -777,6 +803,7 @@ class Multi_Device_Switcher {
|
|
777 |
|
778 |
return $links;
|
779 |
}
|
|
|
780 |
/**
|
781 |
* Set links below a plugin on the Plugins page.
|
782 |
*
|
@@ -791,12 +818,11 @@ class Multi_Device_Switcher {
|
|
791 |
*
|
792 |
* @return array $links
|
793 |
*
|
794 |
-
* @since 1.8.
|
795 |
*/
|
796 |
public function plugin_metadata_links( $links, $file ) {
|
797 |
-
|
798 |
if ( $file == plugin_basename( __MULTI_DEVICE_SWITCHER_FILE__ ) ) {
|
799 |
-
$links[] = '<a href="https://github.com/sponsors/thingsym">' . __( 'Become a sponsor
|
800 |
}
|
801 |
|
802 |
return $links;
|
@@ -873,6 +899,29 @@ class Multi_Device_Switcher {
|
|
873 |
);
|
874 |
}
|
875 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
876 |
/**
|
877 |
* Display option page.
|
878 |
*
|
@@ -938,6 +987,7 @@ class Multi_Device_Switcher {
|
|
938 |
}
|
939 |
$html .= '</select>';
|
940 |
}
|
|
|
941 |
echo $html;
|
942 |
?>
|
943 |
|
@@ -970,6 +1020,7 @@ class Multi_Device_Switcher {
|
|
970 |
}
|
971 |
$html .= '</select>';
|
972 |
}
|
|
|
973 |
echo $html;
|
974 |
?>
|
975 |
|
@@ -1002,6 +1053,7 @@ class Multi_Device_Switcher {
|
|
1002 |
}
|
1003 |
$html .= '</select>';
|
1004 |
}
|
|
|
1005 |
echo $html;
|
1006 |
?>
|
1007 |
|
@@ -1034,6 +1086,7 @@ class Multi_Device_Switcher {
|
|
1034 |
}
|
1035 |
$html .= '</select>';
|
1036 |
}
|
|
|
1037 |
echo $html;
|
1038 |
?>
|
1039 |
|
@@ -1081,6 +1134,7 @@ class Multi_Device_Switcher {
|
|
1081 |
$html .= '</select>';
|
1082 |
$html .= ' <span class="submit"><input type="submit" name="multi_device_switcher_options[delete_custom_switcher_' . $custom_switcher_name . ']" value="' . __( 'Delete', 'multi-device-switcher' ) . '" onclick="return confirm(\'' . esc_html( sprintf( __( 'Are you sure you want to delete %1$s ?', 'multi-device-switcher' ), $custom_switcher_name ) ) . '\');" class="button"></span>';
|
1083 |
}
|
|
|
1084 |
echo $html;
|
1085 |
?>
|
1086 |
</td>
|
@@ -1302,7 +1356,7 @@ class Multi_Device_Switcher {
|
|
1302 |
*
|
1303 |
* @since 1.3.1
|
1304 |
*/
|
1305 |
-
public function
|
1306 |
$options = $this->get_options();
|
1307 |
$default_theme_options = $this->default_options;
|
1308 |
$default_theme = wp_get_theme()->get( 'Name' );
|
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 and custom).
|
6 |
+
* Version: 1.8.1
|
7 |
* Author: thingsym
|
8 |
* Author URI: https://www.thingslabo.com/
|
9 |
* License: GPL2 or later
|
26 |
class Multi_Device_Switcher {
|
27 |
|
28 |
/**
|
29 |
+
* Public variable.
|
30 |
*
|
31 |
+
* @access public
|
32 |
*
|
33 |
* @var string $option_group The group name of option
|
34 |
*/
|
35 |
+
public $option_group = 'multi_device_switcher';
|
36 |
|
37 |
/**
|
38 |
+
* Public variable.
|
39 |
*
|
40 |
+
* @access public
|
41 |
*
|
42 |
* @var string $option_name The option name
|
43 |
*/
|
44 |
+
public $option_name = 'multi_device_switcher_options';
|
45 |
|
46 |
/**
|
47 |
+
* Public variable.
|
48 |
*
|
49 |
+
* @access public
|
50 |
*
|
51 |
* @var string $capability The types of capability
|
52 |
*/
|
53 |
+
public $capability = 'switch_themes';
|
54 |
|
55 |
/**
|
56 |
+
* Public variable.
|
57 |
*
|
58 |
+
* @access public
|
59 |
*
|
60 |
* @var string $cookie_name_multi_device_switcher
|
61 |
*/
|
62 |
+
public $cookie_name_multi_device_switcher = 'multi-device-switcher';
|
63 |
|
64 |
/**
|
65 |
+
* Public variable.
|
66 |
*
|
67 |
+
* @access public
|
68 |
*
|
69 |
* @var string $cookie_name_disable_switcher
|
70 |
*/
|
71 |
+
public $cookie_name_disable_switcher = 'disable-switcher';
|
72 |
|
73 |
/**
|
74 |
+
* Public variable.
|
75 |
*
|
76 |
+
* @access public
|
77 |
*
|
78 |
* @var string $cookie_name_pc_switcher
|
79 |
*/
|
80 |
+
public $cookie_name_pc_switcher = 'pc-switcher';
|
81 |
|
82 |
/**
|
83 |
+
* Public variable.
|
84 |
*
|
85 |
+
* @access public
|
86 |
*
|
87 |
* @var array $default_options {
|
88 |
* default options
|
103 |
*
|
104 |
* @since 1.7.0
|
105 |
*/
|
106 |
+
public $default_options = array(
|
107 |
'pc_switcher' => 1,
|
108 |
'default_css' => 1,
|
109 |
'theme_smartphone' => 'None',
|
119 |
);
|
120 |
|
121 |
/**
|
122 |
+
* Public variable.
|
123 |
*
|
124 |
* @access public
|
125 |
*
|
127 |
*/
|
128 |
public $device = '';
|
129 |
|
130 |
+
/**
|
131 |
+
* Public variable.
|
132 |
+
*
|
133 |
+
* @access public
|
134 |
+
*
|
135 |
+
* @var array|null $plugin_data
|
136 |
+
*/
|
137 |
+
public $plugin_data;
|
138 |
+
|
139 |
/**
|
140 |
* Constructor
|
141 |
*
|
144 |
* @since 1.0.0
|
145 |
*/
|
146 |
public function __construct() {
|
147 |
+
add_action( 'init', array( $this, 'load_plugin_data' ) );
|
148 |
add_action( 'init', array( $this, 'load_textdomain' ) );
|
149 |
add_action( 'init', array( $this, 'init' ) );
|
150 |
|
156 |
|
157 |
add_action( 'admin_init', array( $this, 'register_settings' ) );
|
158 |
add_action( 'admin_menu', array( $this, 'add_option_page' ) );
|
159 |
+
add_action( 'customize_register', array( $this, 'customizer' ) );
|
160 |
add_action( 'plugins_loaded', array( $this, 'load_file' ) );
|
161 |
}
|
162 |
|
198 |
|
199 |
add_action( 'init', array( $this, 'session' ) );
|
200 |
|
201 |
+
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
202 |
$server_ua = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
|
203 |
$user_agent = $this->get_options_user_agent();
|
204 |
|
471 |
*/
|
472 |
public function session() {
|
473 |
if ( isset( $_GET['pc-switcher'] ) ) {
|
474 |
+
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
475 |
setcookie( $this->cookie_name_pc_switcher, $_GET['pc-switcher'] ? '1' : '', 0, '/', '', is_ssl(), false );
|
476 |
|
477 |
+
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
|
478 |
+
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
479 |
+
$uri = preg_replace( '/^(.+?)(\?.*)$/', '$1', $_SERVER['REQUEST_URI'] );
|
480 |
+
}
|
481 |
|
482 |
unset( $_GET['pc-switcher'] );
|
483 |
if ( ! empty( $_GET ) ) {
|
514 |
'pc-switcher-options',
|
515 |
plugins_url() . '/multi-device-switcher/pc-switcher.css',
|
516 |
array(),
|
517 |
+
$this->plugin_data['Version'],
|
518 |
+
'all'
|
519 |
);
|
520 |
}
|
521 |
|
522 |
$uri = is_ssl() ? 'https://' : 'http://';
|
523 |
+
|
524 |
+
if ( isset( $_SERVER['HTTP_HOST'] ) ) {
|
525 |
+
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
526 |
+
$uri .= $_SERVER['HTTP_HOST'];
|
527 |
+
}
|
528 |
|
529 |
if ( isset( $_COOKIE[ $this->cookie_name_pc_switcher ] ) ) {
|
530 |
$uri .= add_query_arg( 'pc-switcher', 0 );
|
591 |
$options = $this->get_options();
|
592 |
$disable_path = preg_split( '/\R/', $options['disable_path'], -1, PREG_SPLIT_NO_EMPTY );
|
593 |
|
594 |
+
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
|
595 |
+
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
596 |
+
$request_uri = $_SERVER['REQUEST_URI'];
|
597 |
+
}
|
598 |
+
|
599 |
foreach ( (array) $disable_path as $path ) {
|
600 |
if ( $options['enable_regex'] ) {
|
601 |
+
if ( preg_match( '/' . $path . '/i', $request_uri ) ) {
|
602 |
$disable = true;
|
603 |
break;
|
604 |
}
|
605 |
}
|
606 |
else {
|
607 |
+
if ( preg_match( '/^' . preg_quote( (string) $path, '/' ) . '$/i', $request_uri ) ) {
|
608 |
$disable = true;
|
609 |
break;
|
610 |
}
|
681 |
'multi-device-switcher-options',
|
682 |
plugins_url() . '/multi-device-switcher/multi-device-switcher.js',
|
683 |
array( 'jquery', 'jquery-ui-tabs' ),
|
684 |
+
$this->plugin_data['Version']
|
685 |
);
|
686 |
}
|
687 |
|
699 |
'multi-device-switcher-options',
|
700 |
plugins_url() . '/multi-device-switcher/multi-device-switcher.css',
|
701 |
array(),
|
702 |
+
$this->plugin_data['Version'],
|
703 |
+
'all'
|
704 |
);
|
705 |
}
|
706 |
|
803 |
|
804 |
return $links;
|
805 |
}
|
806 |
+
|
807 |
/**
|
808 |
* Set links below a plugin on the Plugins page.
|
809 |
*
|
818 |
*
|
819 |
* @return array $links
|
820 |
*
|
821 |
+
* @since 1.8.1
|
822 |
*/
|
823 |
public function plugin_metadata_links( $links, $file ) {
|
|
|
824 |
if ( $file == plugin_basename( __MULTI_DEVICE_SWITCHER_FILE__ ) ) {
|
825 |
+
$links[] = '<a href="https://github.com/sponsors/thingsym">' . __( 'Become a sponsor', 'multi-device-switcher' ) . '</a>';
|
826 |
}
|
827 |
|
828 |
return $links;
|
899 |
);
|
900 |
}
|
901 |
|
902 |
+
/**
|
903 |
+
* Load plugin data
|
904 |
+
*
|
905 |
+
* @access public
|
906 |
+
*
|
907 |
+
* @return boolean
|
908 |
+
*
|
909 |
+
* @since 1.8.1
|
910 |
+
*/
|
911 |
+
public function load_plugin_data() {
|
912 |
+
if ( ! function_exists( 'get_plugin_data' ) ) {
|
913 |
+
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
914 |
+
}
|
915 |
+
|
916 |
+
$this->plugin_data = get_plugin_data( __MULTI_DEVICE_SWITCHER_FILE__ );
|
917 |
+
|
918 |
+
if ( ! $this->plugin_data ) {
|
919 |
+
return false;
|
920 |
+
}
|
921 |
+
|
922 |
+
return true;
|
923 |
+
}
|
924 |
+
|
925 |
/**
|
926 |
* Display option page.
|
927 |
*
|
987 |
}
|
988 |
$html .= '</select>';
|
989 |
}
|
990 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
991 |
echo $html;
|
992 |
?>
|
993 |
|
1020 |
}
|
1021 |
$html .= '</select>';
|
1022 |
}
|
1023 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
1024 |
echo $html;
|
1025 |
?>
|
1026 |
|
1053 |
}
|
1054 |
$html .= '</select>';
|
1055 |
}
|
1056 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
1057 |
echo $html;
|
1058 |
?>
|
1059 |
|
1086 |
}
|
1087 |
$html .= '</select>';
|
1088 |
}
|
1089 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
1090 |
echo $html;
|
1091 |
?>
|
1092 |
|
1134 |
$html .= '</select>';
|
1135 |
$html .= ' <span class="submit"><input type="submit" name="multi_device_switcher_options[delete_custom_switcher_' . $custom_switcher_name . ']" value="' . __( 'Delete', 'multi-device-switcher' ) . '" onclick="return confirm(\'' . esc_html( sprintf( __( 'Are you sure you want to delete %1$s ?', 'multi-device-switcher' ), $custom_switcher_name ) ) . '\');" class="button"></span>';
|
1136 |
}
|
1137 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
1138 |
echo $html;
|
1139 |
?>
|
1140 |
</td>
|
1356 |
*
|
1357 |
* @since 1.3.1
|
1358 |
*/
|
1359 |
+
public function customizer( $wp_customize ) {
|
1360 |
$options = $this->get_options();
|
1361 |
$default_theme_options = $this->default_options;
|
1362 |
$default_theme = wp_get_theme()->get( 'Name' );
|
pc-switcher-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Widget Name: PC Switcher Widget
|
4 |
* Plugin URI: https://github.com/thingsym/multi-device-switcher
|
5 |
* Description: PC Switcher Widget add-on for the Multi Device Switcher. Use this widget to add the PC Switcher to a widget.
|
6 |
-
* Version: 1.8.
|
7 |
* Author: thingsym
|
8 |
* Author URI: https://www.thingslabo.com/
|
9 |
* License: GPL2 or later
|
@@ -78,8 +78,10 @@ class PC_Switcher extends WP_Widget {
|
|
78 |
$name = $multi_device_switcher->get_device_theme();
|
79 |
|
80 |
if ( $name && 'None' !== $name ) {
|
|
|
81 |
echo $args['before_widget'];
|
82 |
multi_device_switcher_add_pc_switcher();
|
|
|
83 |
echo $args['after_widget'];
|
84 |
}
|
85 |
}
|
3 |
* Widget Name: PC Switcher Widget
|
4 |
* Plugin URI: https://github.com/thingsym/multi-device-switcher
|
5 |
* Description: PC Switcher Widget add-on for the Multi Device Switcher. Use this widget to add the PC Switcher to a widget.
|
6 |
+
* Version: 1.8.1
|
7 |
* Author: thingsym
|
8 |
* Author URI: https://www.thingslabo.com/
|
9 |
* License: GPL2 or later
|
78 |
$name = $multi_device_switcher->get_device_theme();
|
79 |
|
80 |
if ( $name && 'None' !== $name ) {
|
81 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
82 |
echo $args['before_widget'];
|
83 |
multi_device_switcher_add_pc_switcher();
|
84 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
85 |
echo $args['after_widget'];
|
86 |
}
|
87 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: thingsym
|
|
4 |
Link: https://github.com/thingsym/multi-device-switcher
|
5 |
Donate link: https://github.com/sponsors/thingsym
|
6 |
Tags: switcher, theme, ipad, iphone, android, tablet, mobile, game
|
7 |
-
Stable tag: 1.8.
|
8 |
Tested up to: 5.8.0
|
9 |
Requires at least: 3.7
|
10 |
Requires PHP: 5.4
|
@@ -365,6 +365,25 @@ For more information about the Multi Device Switcher Command, see `wp help multi
|
|
365 |
|
366 |
== Changelog ==
|
367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
= 1.8.0 =
|
369 |
* add PHPDoc
|
370 |
* update japanese translation
|
4 |
Link: https://github.com/thingsym/multi-device-switcher
|
5 |
Donate link: https://github.com/sponsors/thingsym
|
6 |
Tags: switcher, theme, ipad, iphone, android, tablet, mobile, game
|
7 |
+
Stable tag: 1.8.1
|
8 |
Tested up to: 5.8.0
|
9 |
Requires at least: 3.7
|
10 |
Requires PHP: 5.4
|
365 |
|
366 |
== Changelog ==
|
367 |
|
368 |
+
= 1.8.1 =
|
369 |
+
* update japanese translation
|
370 |
+
* update pot
|
371 |
+
* imporve code with phpcs
|
372 |
+
* update wordpress-test-matrix
|
373 |
+
* fix test case
|
374 |
+
* fix plugin_metadata_links method
|
375 |
+
* add load_plugin_data method
|
376 |
+
* rename variable from options to option_name
|
377 |
+
* add test case for customizer
|
378 |
+
* rename method name
|
379 |
+
* update composer dependencies
|
380 |
+
* change from protected variable to public variable for unit test
|
381 |
+
* add timeout-minutes to workflows
|
382 |
+
* add phpunit-polyfills
|
383 |
+
* update install-wp-tests.sh
|
384 |
+
* tested up to 5.8.0
|
385 |
+
* fix .editorconfig
|
386 |
+
|
387 |
= 1.8.0 =
|
388 |
* add PHPDoc
|
389 |
* update japanese translation
|
wp-cli.php
CHANGED
@@ -13,13 +13,13 @@
|
|
13 |
class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
*
|
18 |
-
* @access
|
19 |
*
|
20 |
-
* @var string $
|
21 |
*/
|
22 |
-
|
23 |
|
24 |
/**
|
25 |
* Get status of settings
|
@@ -29,7 +29,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
29 |
* wp multi-device status
|
30 |
*/
|
31 |
public function status( $args, $assoc_args ) {
|
32 |
-
$options = get_option( $this->
|
33 |
$rows = array();
|
34 |
|
35 |
$slug_table = array( 'None' => '' );
|
@@ -129,7 +129,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
129 |
$slug = isset( $args[1] ) ? $args[1] : null;
|
130 |
$theme = isset( $assoc_args['theme'] ) ? $assoc_args['theme'] : null;
|
131 |
|
132 |
-
$options = get_option( $this->
|
133 |
|
134 |
if ( isset( $slug ) ) {
|
135 |
if ( '' == $slug || 'None' == $slug ) {
|
@@ -166,13 +166,13 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
166 |
}
|
167 |
$options[ 'theme_' . $name ] = $theme;
|
168 |
|
169 |
-
update_option( $this->
|
170 |
WP_CLI::success( 'switch ' . $name . ' theme to ' . $theme );
|
171 |
}
|
172 |
elseif ( isset( $options[ 'custom_switcher_theme_' . $name ] ) ) {
|
173 |
$options[ 'custom_switcher_theme_' . $name ] = $theme;
|
174 |
|
175 |
-
update_option( $this->
|
176 |
WP_CLI::success( 'switch ' . $name . ' theme to ' . $theme );
|
177 |
}
|
178 |
else {
|
@@ -221,7 +221,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
221 |
$name = isset( $args[0] ) ? $args[0] : null;
|
222 |
$useragent = isset( $args[1] ) ? $args[1] : null;
|
223 |
|
224 |
-
$options = get_option( $this->
|
225 |
|
226 |
if ( isset( $useragent ) ) {
|
227 |
if ( in_array( $name, array( 'smartphone', 'smart', 'tablet', 'mobile', 'game' ) ) ) {
|
@@ -230,13 +230,13 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
230 |
}
|
231 |
$options[ 'userAgent_' . $name ] = $useragent;
|
232 |
|
233 |
-
update_option( $this->
|
234 |
WP_CLI::success( 'set ' . $name . ' UserAgent to ' . $useragent );
|
235 |
}
|
236 |
elseif ( isset( $options[ 'custom_switcher_theme_' . $name ] ) ) {
|
237 |
$options[ 'custom_switcher_userAgent_' . $name ] = $useragent;
|
238 |
|
239 |
-
update_option( $this->
|
240 |
WP_CLI::success( 'set ' . $name . ' UserAgent to ' . $useragent );
|
241 |
}
|
242 |
else {
|
@@ -269,7 +269,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
269 |
* @synopsis
|
270 |
*/
|
271 |
public function reset( $args, $assoc_args ) {
|
272 |
-
$options = get_option( $this->
|
273 |
$default_options = multi_device_switcher_get_default_options();
|
274 |
|
275 |
$options['userAgent_smart'] = $default_options['userAgent_smart'];
|
@@ -277,7 +277,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
277 |
$options['userAgent_mobile'] = $default_options['userAgent_mobile'];
|
278 |
$options['userAgent_game'] = $default_options['userAgent_game'];
|
279 |
|
280 |
-
update_option( $this->
|
281 |
WP_CLI::success( 'reset Settings to Default UserAgent' );
|
282 |
}
|
283 |
|
@@ -332,7 +332,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
332 |
}
|
333 |
}
|
334 |
|
335 |
-
$options = get_option( $this->
|
336 |
if ( in_array( $name, array( 'smartphone', 'smart', 'tablet', 'mobile', 'game' ) ) ) {
|
337 |
WP_CLI::error( 'Default Switcher can\'t add' );
|
338 |
}
|
@@ -359,7 +359,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
359 |
|
360 |
$options[ 'custom_switcher_userAgent_' . $name ] = isset( $useragent ) ? $useragent : '';
|
361 |
|
362 |
-
update_option( $this->
|
363 |
WP_CLI::success( 'add ' . $name . ' Custom Switcher' );
|
364 |
}
|
365 |
}
|
@@ -382,7 +382,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
382 |
public function delete( $args, $assoc_args ) {
|
383 |
$name = isset( $args[0] ) ? $args[0] : null;
|
384 |
|
385 |
-
$options = get_option( $this->
|
386 |
|
387 |
if ( in_array( $name, array( 'smartphone', 'smart', 'tablet', 'mobile', 'game' ) ) ) {
|
388 |
WP_CLI::error( 'Default Switcher can\'t delete' );
|
@@ -391,7 +391,7 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
391 |
unset( $options[ 'custom_switcher_theme_' . $name ] );
|
392 |
unset( $options[ 'custom_switcher_userAgent_' . $name ] );
|
393 |
|
394 |
-
update_option( $this->
|
395 |
WP_CLI::success( 'delete ' . $name . ' Custom Switcher' );
|
396 |
}
|
397 |
else {
|
@@ -422,16 +422,16 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
422 |
public function pc_switcher( $args, $assoc_args ) {
|
423 |
$flag = isset( $args[0] ) ? $args[0] : null;
|
424 |
|
425 |
-
$options = get_option( $this->
|
426 |
|
427 |
if ( 'on' == $flag ) {
|
428 |
$options['pc_switcher'] = 1;
|
429 |
-
update_option( $this->
|
430 |
WP_CLI::success( 'turn on PC Switcher' );
|
431 |
}
|
432 |
elseif ( 'off' == $flag ) {
|
433 |
$options['pc_switcher'] = 0;
|
434 |
-
update_option( $this->
|
435 |
WP_CLI::success( 'turn off PC Switcher' );
|
436 |
}
|
437 |
else {
|
@@ -461,16 +461,16 @@ class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
|
461 |
public function css( $args, $assoc_args ) {
|
462 |
$flag = isset( $args[0] ) ? $args[0] : null;
|
463 |
|
464 |
-
$options = get_option( $this->
|
465 |
|
466 |
if ( 'on' == $flag ) {
|
467 |
$options['default_css'] = 1;
|
468 |
-
update_option( $this->
|
469 |
WP_CLI::success( 'turn on default CSS' );
|
470 |
}
|
471 |
elseif ( 'off' == $flag ) {
|
472 |
$options['default_css'] = 0;
|
473 |
-
update_option( $this->
|
474 |
WP_CLI::success( 'turn off default CSS' );
|
475 |
}
|
476 |
else {
|
13 |
class Multi_Device_Switcher_Command extends WP_CLI_Command {
|
14 |
|
15 |
/**
|
16 |
+
* Public variable.
|
17 |
*
|
18 |
+
* @access public
|
19 |
*
|
20 |
+
* @var string $option_name The option name
|
21 |
*/
|
22 |
+
public $option_name = 'multi_device_switcher_options';
|
23 |
|
24 |
/**
|
25 |
* Get status of settings
|
29 |
* wp multi-device status
|
30 |
*/
|
31 |
public function status( $args, $assoc_args ) {
|
32 |
+
$options = get_option( $this->option_name );
|
33 |
$rows = array();
|
34 |
|
35 |
$slug_table = array( 'None' => '' );
|
129 |
$slug = isset( $args[1] ) ? $args[1] : null;
|
130 |
$theme = isset( $assoc_args['theme'] ) ? $assoc_args['theme'] : null;
|
131 |
|
132 |
+
$options = get_option( $this->option_name );
|
133 |
|
134 |
if ( isset( $slug ) ) {
|
135 |
if ( '' == $slug || 'None' == $slug ) {
|
166 |
}
|
167 |
$options[ 'theme_' . $name ] = $theme;
|
168 |
|
169 |
+
update_option( $this->option_name, $options );
|
170 |
WP_CLI::success( 'switch ' . $name . ' theme to ' . $theme );
|
171 |
}
|
172 |
elseif ( isset( $options[ 'custom_switcher_theme_' . $name ] ) ) {
|
173 |
$options[ 'custom_switcher_theme_' . $name ] = $theme;
|
174 |
|
175 |
+
update_option( $this->option_name, $options );
|
176 |
WP_CLI::success( 'switch ' . $name . ' theme to ' . $theme );
|
177 |
}
|
178 |
else {
|
221 |
$name = isset( $args[0] ) ? $args[0] : null;
|
222 |
$useragent = isset( $args[1] ) ? $args[1] : null;
|
223 |
|
224 |
+
$options = get_option( $this->option_name );
|
225 |
|
226 |
if ( isset( $useragent ) ) {
|
227 |
if ( in_array( $name, array( 'smartphone', 'smart', 'tablet', 'mobile', 'game' ) ) ) {
|
230 |
}
|
231 |
$options[ 'userAgent_' . $name ] = $useragent;
|
232 |
|
233 |
+
update_option( $this->option_name, $options );
|
234 |
WP_CLI::success( 'set ' . $name . ' UserAgent to ' . $useragent );
|
235 |
}
|
236 |
elseif ( isset( $options[ 'custom_switcher_theme_' . $name ] ) ) {
|
237 |
$options[ 'custom_switcher_userAgent_' . $name ] = $useragent;
|
238 |
|
239 |
+
update_option( $this->option_name, $options );
|
240 |
WP_CLI::success( 'set ' . $name . ' UserAgent to ' . $useragent );
|
241 |
}
|
242 |
else {
|
269 |
* @synopsis
|
270 |
*/
|
271 |
public function reset( $args, $assoc_args ) {
|
272 |
+
$options = get_option( $this->option_name );
|
273 |
$default_options = multi_device_switcher_get_default_options();
|
274 |
|
275 |
$options['userAgent_smart'] = $default_options['userAgent_smart'];
|
277 |
$options['userAgent_mobile'] = $default_options['userAgent_mobile'];
|
278 |
$options['userAgent_game'] = $default_options['userAgent_game'];
|
279 |
|
280 |
+
update_option( $this->option_name, $options );
|
281 |
WP_CLI::success( 'reset Settings to Default UserAgent' );
|
282 |
}
|
283 |
|
332 |
}
|
333 |
}
|
334 |
|
335 |
+
$options = get_option( $this->option_name );
|
336 |
if ( in_array( $name, array( 'smartphone', 'smart', 'tablet', 'mobile', 'game' ) ) ) {
|
337 |
WP_CLI::error( 'Default Switcher can\'t add' );
|
338 |
}
|
359 |
|
360 |
$options[ 'custom_switcher_userAgent_' . $name ] = isset( $useragent ) ? $useragent : '';
|
361 |
|
362 |
+
update_option( $this->option_name, $options );
|
363 |
WP_CLI::success( 'add ' . $name . ' Custom Switcher' );
|
364 |
}
|
365 |
}
|
382 |
public function delete( $args, $assoc_args ) {
|
383 |
$name = isset( $args[0] ) ? $args[0] : null;
|
384 |
|
385 |
+
$options = get_option( $this->option_name );
|
386 |
|
387 |
if ( in_array( $name, array( 'smartphone', 'smart', 'tablet', 'mobile', 'game' ) ) ) {
|
388 |
WP_CLI::error( 'Default Switcher can\'t delete' );
|
391 |
unset( $options[ 'custom_switcher_theme_' . $name ] );
|
392 |
unset( $options[ 'custom_switcher_userAgent_' . $name ] );
|
393 |
|
394 |
+
update_option( $this->option_name, $options );
|
395 |
WP_CLI::success( 'delete ' . $name . ' Custom Switcher' );
|
396 |
}
|
397 |
else {
|
422 |
public function pc_switcher( $args, $assoc_args ) {
|
423 |
$flag = isset( $args[0] ) ? $args[0] : null;
|
424 |
|
425 |
+
$options = get_option( $this->option_name );
|
426 |
|
427 |
if ( 'on' == $flag ) {
|
428 |
$options['pc_switcher'] = 1;
|
429 |
+
update_option( $this->option_name, $options );
|
430 |
WP_CLI::success( 'turn on PC Switcher' );
|
431 |
}
|
432 |
elseif ( 'off' == $flag ) {
|
433 |
$options['pc_switcher'] = 0;
|
434 |
+
update_option( $this->option_name, $options );
|
435 |
WP_CLI::success( 'turn off PC Switcher' );
|
436 |
}
|
437 |
else {
|
461 |
public function css( $args, $assoc_args ) {
|
462 |
$flag = isset( $args[0] ) ? $args[0] : null;
|
463 |
|
464 |
+
$options = get_option( $this->option_name );
|
465 |
|
466 |
if ( 'on' == $flag ) {
|
467 |
$options['default_css'] = 1;
|
468 |
+
update_option( $this->option_name, $options );
|
469 |
WP_CLI::success( 'turn on default CSS' );
|
470 |
}
|
471 |
elseif ( 'off' == $flag ) {
|
472 |
$options['default_css'] = 0;
|
473 |
+
update_option( $this->option_name, $options );
|
474 |
WP_CLI::success( 'turn off default CSS' );
|
475 |
}
|
476 |
else {
|