PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.6
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.6
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / inc / modules / quick-social-links / admin / options.php

options.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.6, at inc/modules/quick-social-links/admin/options.php

416 lines 11.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Quick Social Links Options.
5 *
6 * @package Merchant
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13 // Settings
14 Merchant_Admin_Options::create( array(
15 'module' => Merchant_Quick_Social_Links::MODULE_ID,
16 'title' => esc_html__( 'Settings', 'merchant' ),
17 'fields' => array(
18 array(
19 'id' => 'layout',
20 'type' => 'choices',
21 'title' => esc_html__( 'Layout', 'merchant' ),
22 'options' => array(
23 'pos-bottom' => array(
24 'image' => '%s/qlb.svg',
25 'label' => esc_html__( 'Bottom', 'merchant' ),
26 ),
27 'pos-left' => array(
28 'image' => '%s/qll.svg',
29 'label' => esc_html__( 'Left', 'merchant' ),
30 ),
31 'pos-right' => array(
32 'image' => '%s/qlr.svg',
33 'label' => esc_html__( 'Right', 'merchant' ),
34 )
35 ),
36 'default' => 'pos-bottom',
37 ),
38 array(
39 'id' => 'visibility',
40 'type' => 'select',
41 'title' => esc_html__( 'Visibility', 'merchant' ),
42 'options' => array(
43 'visibility-all' => esc_html__( 'Show on all devices', 'merchant' ),
44 'visibility-desktop' => esc_html__( 'Desktop only', 'merchant' ),
45 'visibility-mobile' => esc_html__( 'Mobile/Tablet only', 'merchant' )
46 ),
47 'default' => 'visibility-all',
48 ),
49 ),
50 ) );
51
52 // Link settings
53 Merchant_Admin_Options::create( array(
54 'module' => Merchant_Quick_Social_Links::MODULE_ID,
55 'title' => esc_html__( 'Style Settings', 'merchant' ),
56 'fields' => array(
57 array(
58 'id' => 'icon_color',
59 'type' => 'color',
60 'title' => esc_html__( 'Icon color', 'merchant' ),
61 'default' => '#212121'
62 ),
63
64 array(
65 'id' => 'bg_color',
66 'type' => 'color',
67 'title' => esc_html__( 'Background color', 'merchant' ),
68 'default' => '#ffffff'
69 ),
70
71 array(
72 'id' => 'border_radius',
73 'type' => 'range',
74 'title' => esc_html__( 'Border radius', 'merchant' ),
75 'min' => 1,
76 'max' => 500,
77 'step' => 1,
78 'unit' => 'px',
79 'default' => 15,
80 ),
81 )
82 )
83 );
84
85 // Get the user roles
86 $user_roles = array();
87 $user_rules = get_editable_roles();
88
89 if ( ! empty( $user_rules ) ) {
90 foreach ( $user_rules as $role_id => $role_data ) {
91 $user_roles[] = array(
92 'id' => 'user_role_' . $role_id,
93 'text' => $role_data['name'],
94 );
95 }
96 }
97
98
99 // Link settings
100 Merchant_Admin_Options::create( array(
101 'module' => Merchant_Quick_Social_Links::MODULE_ID,
102 'title' => esc_html__( 'Display Conditions', 'merchant' ),
103 'fields' => array(
104
105 array(
106 'id' => 'condition_rules',
107 'type' => 'flexible_content',
108 'style' => 'table',
109 'button_label' => esc_html__( 'Add new', 'merchant' ),
110 'layouts' => array(
111 'display' => array(
112 'title' => esc_html__( 'Display condition', 'merchant' ),
113 'fields' => array(
114 array(
115 'id' => 'type',
116 'title' => esc_html__( 'Inclusion', 'merchant' ),
117 'type' => 'select',
118 'options' => array(
119 'include' => esc_html__( 'Include', 'merchant' ),
120 'exclude' => esc_html__( 'Exclude', 'merchant' ),
121 )
122 ),
123 array(
124 'id' => 'condition',
125 'type' => 'select_ajax',
126 'title' => __( 'Condition', 'merchant' ),
127 'source' => 'options',
128 'multiple' => false,
129 'classes' => array(
130 'flex-grow'
131 ),
132 'options' => array(
133 array(
134 'id' => 'all',
135 'text' => esc_html__( 'Entire Site', 'merchant' ),
136 ),
137 array(
138 'id' => 'basic',
139 'text' => esc_html__( 'Basic', 'merchant' ),
140 'options' => array(
141 array(
142 'id' => 'singular',
143 'text' => esc_html__( 'Singulars', 'merchant' ),
144 ),
145 array(
146 'id' => 'archive',
147 'text' => esc_html__( 'Archives', 'merchant' ),
148 ),
149 )
150 ),
151 array(
152 'id' => 'posts',
153 'text' => esc_html__( 'Posts', 'merchant' ),
154 'options' => array(
155 array(
156 'id' => 'single-post',
157 'text' => esc_html__( 'Single Post', 'merchant' ),
158 ),
159 array(
160 'id' => 'post-archives',
161 'text' => esc_html__( 'Post Archives', 'merchant' ),
162 ),
163 array(
164 'id' => 'post-categories',
165 'text' => esc_html__( 'Post Categories', 'merchant' ),
166 ),
167 array(
168 'id' => 'post-tags',
169 'text' => esc_html__( 'Post Tags', 'merchant' ),
170 ),
171 ),
172 ),
173 array(
174 'id' => 'pages',
175 'text' => esc_html__( 'Pages', 'merchant' ),
176 'options' => array(
177 array(
178 'id' => 'single-page',
179 'text' => esc_html__( 'Single Page', 'merchant' ),
180 ),
181 ),
182 ),
183 array(
184 'id' => 'woocommerce',
185 'text' => esc_html__( 'WooCommerce', 'merchant' ),
186 'options' => array(
187 array(
188 'id' => 'cart-page',
189 'text' => esc_html__( 'Cart', 'merchant' ),
190 ),
191 array(
192 'id' => 'checkout-page',
193 'text' => esc_html__( 'Checkout', 'merchant' ),
194 ),
195 array(
196 'id' => 'single-product',
197 'text' => esc_html__( 'Single Product', 'merchant' ),
198 ),
199 array(
200 'id' => 'product-archives',
201 'text' => esc_html__( 'Product Archives', 'merchant' ),
202 ),
203 array(
204 'id' => 'product-categories',
205 'text' => esc_html__( 'Product Categories', 'merchant' ),
206 ),
207 array(
208 'id' => 'product-tags',
209 'text' => esc_html__( 'Product Tags', 'merchant' ),
210 ),
211 array(
212 'id' => 'account-page',
213 'text' => esc_html__( 'My Account', 'merchant' ),
214 ),
215 array(
216 'id' => 'edit-account-page',
217 'text' => esc_html__( 'Edit Account', 'merchant' ),
218 ),
219 array(
220 'id' => 'order-received-page',
221 'text' => esc_html__( 'Order Received', 'merchant' ),
222 ),
223 array(
224 'id' => 'view-order-page',
225 'text' => esc_html__( 'View Order', 'merchant' ),
226 ),
227 array(
228 'id' => 'lost-password-page',
229 'text' => esc_html__( 'Lost Password', 'merchant' ),
230 )
231 ),
232 ),
233 array(
234 'id' => 'other',
235 'text' => esc_html__( 'Other', 'merchant' ),
236 'options' => array(
237 array(
238 'id' => 'front-page',
239 'text' => esc_html__( 'Front Page', 'merchant' ),
240 ),
241 array(
242 'id' => 'blog',
243 'text' => esc_html__( 'Blog', 'merchant' ),
244 ),
245 array(
246 'id' => 'search',
247 'text' => esc_html__( 'Search', 'merchant' ),
248 ),
249 array(
250 'id' => '404',
251 'text' => esc_html__( '404', 'merchant' ),
252 ),
253 array(
254 'id' => 'author',
255 'text' => esc_html__( 'Author', 'merchant' ),
256 ),
257 array(
258 'id' => 'privacy-policy-page',
259 'text' => esc_html__( 'Privacy Policy Page', 'merchant' ),
260 ),
261 ),
262 )
263 )
264 ),
265 )
266 ),
267 'user' => array(
268 'title' => esc_html__( 'User condition', 'merchant' ),
269 'fields' => array(
270 array(
271 'id' => 'type',
272 'title' => esc_html__( 'Inclusion', 'merchant' ),
273 'type' => 'select',
274 'options' => array(
275 'include' => esc_html__( 'Include', 'merchant' ),
276 'exclude' => esc_html__( 'Exclude', 'merchant' ),
277 )
278 ),
279 array(
280 'id' => 'condition',
281 'type' => 'select_ajax',
282 'title' => __( 'Condition', 'merchant' ),
283 'source' => 'options',
284 'multiple' => false,
285 'classes' => array(
286 'flex-grow'
287 ),
288 'options' => array(
289 array(
290 'id' => 'user-auth',
291 'text' => esc_html__( 'User Auth', 'merchant' ),
292 'options' => array(
293 array(
294 'id' => 'logged-in',
295 'text' => esc_html__( 'User Logged In', 'merchant' ),
296 ),
297 array(
298 'id' => 'logged-out',
299 'text' => esc_html__( 'User Logged Out', 'merchant' ),
300 ),
301 ),
302 ),
303 array(
304 'id' => 'user-roles',
305 'text' => esc_html__( 'User Roles', 'merchant' ),
306 'options' => $user_roles,
307 ),
308 array(
309 'id' => 'other',
310 'text' => esc_html__( 'Other', 'merchant' ),
311 'options' => array(
312 array(
313 'id' => 'author',
314 'text' => esc_html__( 'Author', 'merchant' ),
315 'ajax' => true,
316 ),
317 ),
318 ),
319 ),
320 ),
321 )
322 ),
323 ),
324 'default' => array(
325 array(
326 'layout' => 'display',
327 'condition' => 'all',
328 'type' => 'include'
329 )
330 )
331 ),
332 )
333 ) );
334
335
336 // Create the social icon choices.
337 $social_icon_choices = array();
338
339 foreach ( Merchant_Quick_Social_Links::get_socials() as $key => $label ) {
340 $social_icon_choices[ $key ] = array(
341 'label' => $label,
342 'svg' => "icon-{$key}",
343 );
344 }
345
346
347 // Link settings
348 Merchant_Admin_Options::create( array(
349 'module' => Merchant_Quick_Social_Links::MODULE_ID,
350 'title' => esc_html__( 'Links', 'merchant' ),
351 'fields' => array(
352
353 array(
354 'id' => 'links',
355 'type' => 'flexible_content',
356 'sorting' => true,
357 'desc' => esc_html__( 'Add a social link with an associated icon, or insert a custom link and upload your preferred image or SVG', 'merchant' ),
358 'button_label' => esc_html__( 'Add new', 'merchant' ),
359 'layouts' => array(
360 'social' => array(
361 'title' => esc_html__( 'Social link', 'merchant' ),
362 'fields' => array(
363 array(
364 'id' => 'icon',
365 'type' => 'choices',
366 'title' => esc_html__( 'Icon', 'merchant' ),
367 'options' => $social_icon_choices,
368 'default' => 'cart-icon-1',
369 ),
370 array(
371 'id' => 'url',
372 'title' => esc_html__( 'URL', 'merchant' ),
373 'type' => 'text',
374 'default' => 'https://',
375 'desc' => esc_html__( 'After entering the complete URL, an associated icon will be automatically chosen.', 'merchant' ),
376 ),
377 )
378 ),
379 'custom' => array(
380 'title' => esc_html__( 'Custom link', 'merchant' ),
381 'fields' => array(
382 array(
383 'id' => "image",
384 'type' => 'upload',
385 'title' => __( 'Select custom image or SVG', 'merchant' ),
386 ),
387 array(
388 'id' => 'url',
389 'title' => esc_html__( 'URL', 'merchant' ),
390 'type' => 'text',
391 'default' => 'https://'
392 ),
393 )
394 ),
395 ),
396 'default' => array(
397 array(
398 'layout' => 'social',
399 'icon' => 'facebook',
400 'url' => esc_html__( 'https://www.facebook.com', 'merchant' )
401 ),
402 array(
403 'layout' => 'social',
404 'icon' => 'instagram',
405 'url' => esc_html__( 'https://www.instagram.com', 'merchant' )
406 ),
407 array(
408 'layout' => 'social',
409 'icon' => 'twitter',
410 'url' => esc_html__( 'https://www.twitter.com', 'merchant' )
411 ),
412 )
413 ),
414 )
415 ) );
416