PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.3.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.3.2
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 2.3.2, at inc/modules/quick-social-links/admin/options.php

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