PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.1.1
ShopBuilder – WooCommerce Builder For Elementor v2.1.1
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Helper / ControlHelper.php

ControlHelper.php in ShopBuilder – WooCommerce Builder For Elementor 2.1.1, at app/Elementor/Helper/ControlHelper.php

719 lines 20.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * BuilderFns class
4 *
5 * The builder.
6 *
7 * @package RadiusTheme\SB
8 * @since 1.0.0
9 */
10
11 namespace RadiusTheme\SB\Elementor\Helper;
12
13 // Do not allow directly accessing this file.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit( 'This script cannot be accessed directly.' );
16 }
17
18 /**
19 * BuilderFns class
20 */
21 class ControlHelper {
22 /**
23 * Widget alignment.
24 *
25 * @return array
26 */
27 public static function alignment() {
28 return [
29 'left' => [
30 'title' => esc_html__( 'Left', 'shopbuilder' ),
31 'icon' => 'eicon-text-align-left',
32 ],
33 'center' => [
34 'title' => esc_html__( 'Center', 'shopbuilder' ),
35 'icon' => 'eicon-text-align-center',
36 ],
37 'right' => [
38 'title' => esc_html__( 'Right', 'shopbuilder' ),
39 'icon' => 'eicon-text-align-right',
40 ],
41 'justify' => [
42 'title' => esc_html__( 'Justified', 'shopbuilder' ),
43 'icon' => 'eicon-text-align-justify',
44 ],
45 ];
46 }
47 /**
48 * Widget alignment.
49 *
50 * @return array
51 */
52 public static function flex_alignment() {
53 return [
54 'start' => [
55 'title' => esc_html__( 'Start', 'shopbuilder' ),
56 'icon' => 'eicon-text-align-left',
57 ],
58 'center' => [
59 'title' => esc_html__( 'Center', 'shopbuilder' ),
60 'icon' => 'eicon-text-align-center',
61 ],
62 'end' => [
63 'title' => esc_html__( 'End', 'shopbuilder' ),
64 'icon' => 'eicon-text-align-right',
65 ],
66 ];
67 }
68 /**
69 * Grid Layout Columns
70 *
71 * @return array
72 */
73 public static function layout_columns() {
74 return [
75 0 => esc_html__( 'Layout Default', 'shopbuilder' ),
76 1 => esc_html__( '1 Column', 'shopbuilder' ),
77 2 => esc_html__( '2 Columns', 'shopbuilder' ),
78 3 => esc_html__( '3 Columns', 'shopbuilder' ),
79 4 => esc_html__( '4 Columns', 'shopbuilder' ),
80 5 => esc_html__( '5 Columns', 'shopbuilder' ),
81 6 => esc_html__( '6 Columns', 'shopbuilder' ),
82 7 => esc_html__( '7 Columns', 'shopbuilder' ),
83 8 => esc_html__( '8 Columns', 'shopbuilder' ),
84 ];
85 }
86
87 /**
88 * Grid Layouts
89 *
90 * @return array
91 */
92 public static function grid_layouts() {
93 $status = ! rtsb()->has_pro();
94
95 return apply_filters(
96 'rtsb/elements/elementor/grid_layouts',
97 [
98 'grid-layout1' => [
99 'title' => esc_html__( 'Grid Layout 1', 'shopbuilder' ),
100 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-1.png' ) ),
101 ],
102
103 'grid-layout2' => [
104 'title' => esc_html__( 'Grid Layout 2', 'shopbuilder' ),
105 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-2.png' ) ),
106 ],
107
108 'grid-layout3' => [
109 'title' => esc_html__( 'Grid Layout 3', 'shopbuilder' ),
110 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-3.png' ) ),
111 'is_pro' => $status,
112 ],
113 'grid-layout4' => [
114 'title' => esc_html__( 'Grid Layout 4', 'shopbuilder' ),
115 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-4.png' ) ),
116 'is_pro' => $status,
117 ],
118 'grid-layout5' => [
119 'title' => esc_html__( 'Grid Layout 5', 'shopbuilder' ),
120 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-5.png' ) ),
121 'is_pro' => $status,
122 ],
123 'grid-layout6' => [
124 'title' => esc_html__( 'Grid Layout 6', 'shopbuilder' ),
125 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-6.png' ) ),
126 'is_pro' => $status,
127 ],
128 'grid-layout7' => [
129 'title' => esc_html__( 'Grid Layout 7', 'shopbuilder' ),
130 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-7.png' ) ),
131 'is_pro' => $status,
132 ],
133 'grid-layout8' => [
134 'title' => esc_html__( 'Grid Layout 8', 'shopbuilder' ),
135 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-7.png' ) ),
136 'is_pro' => $status,
137 ],
138
139 ]
140 );
141 }
142
143 /**
144 * Single Product Tab Layouts
145 *
146 * @return array
147 */
148 public static function single_product_tab_layouts() {
149 $status = ! rtsb()->has_pro();
150
151 return apply_filters(
152 'rtsb/elements/elementor/single_product_tab_layouts',
153 [
154 'default' => [
155 'title' => esc_html__( 'Default Layout', 'shopbuilder' ),
156 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-01.png' ) ),
157 ],
158 'custom-layout1' => [
159 'title' => esc_html__( 'Accordion Layout', 'shopbuilder' ),
160 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-02.png' ) ),
161 'is_pro' => $status,
162 ],
163 'custom-layout2' => [
164 'title' => esc_html__( 'Tab Layout', 'shopbuilder' ),
165 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-03.png' ) ),
166 'is_pro' => $status,
167 ],
168 ]
169 );
170 }
171
172 /**
173 * Multi Step Checkout Layouts
174 *
175 * @return array
176 */
177 public static function multi_step_checkout_layouts() {
178 $status = ! rtsb()->has_pro();
179
180 return apply_filters(
181 'rtsb/elements/elementor/single_product_tab_layouts',
182 [
183 'layout1' => [
184 'title' => esc_html__( 'Layout 1', 'shopbuilder' ),
185 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-01.png' ) ),
186 ],
187
188 ]
189 );
190 }
191
192 /**
193 * Single Advanced Product Tab Layouts
194 *
195 * @return array
196 */
197 public static function single_advanced_product_tab_layouts() {
198 // TODO:: Check If the FUnction Used Or Not.
199 return apply_filters(
200 'rtsb/elements/elementor/single_advanced_product_tab_layouts',
201 [
202 'default' => [
203 'title' => esc_html__( 'Default Layout', 'shopbuilder' ),
204 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-01.png' ) ),
205 ],
206 'custom-layout1' => [
207 'title' => esc_html__( 'Accordion Layout', 'shopbuilder' ),
208 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-02.png' ) ),
209 ],
210 'custom-layout2' => [
211 'title' => esc_html__( 'Tab Layout', 'shopbuilder' ),
212 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-03.png' ) ),
213 ],
214 ]
215 );
216 }
217
218 /**
219 * Slider Layouts
220 *
221 * @return array
222 */
223 public static function slider_layouts() {
224 $status = ! rtsb()->has_pro();
225
226 return apply_filters(
227 'rtsb/elements/elementor/slider_layouts',
228 [
229 'slider-layout1' => [
230 'title' => esc_html__( 'Slider Layout 1', 'shopbuilder' ),
231 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-1.png' ) ),
232 ],
233
234 'slider-layout2' => [
235 'title' => esc_html__( 'Slider Layout 2', 'shopbuilder' ),
236 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-2.png' ) ),
237 ],
238
239 'slider-layout3' => [
240 'title' => esc_html__( 'Slider Layout 3', 'shopbuilder' ),
241 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-3.png' ) ),
242 'is_pro' => $status,
243 ],
244
245 'slider-layout4' => [
246 'title' => esc_html__( 'Slider Layout 4', 'shopbuilder' ),
247 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-4.png' ) ),
248 'is_pro' => $status,
249 ],
250 'slider-layout5' => [
251 'title' => esc_html__( 'Slider Layout 5', 'shopbuilder' ),
252 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-5.png' ) ),
253 'is_pro' => $status,
254 ],
255 'slider-layout6' => [
256 'title' => esc_html__( 'Slider Layout 6', 'shopbuilder' ),
257 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-6.png' ) ),
258 'is_pro' => $status,
259 ],
260 'slider-layout7' => [
261 'title' => esc_html__( 'Slider Layout 7', 'shopbuilder' ),
262 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-7.png' ) ),
263 'is_pro' => $status,
264 ],
265 'slider-layout8' => [
266 'title' => esc_html__( 'Slider Layout 8', 'shopbuilder' ),
267 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-6.png' ) ),
268 'is_pro' => $status,
269 ],
270 ]
271 );
272 }
273
274 /**
275 * List Layouts
276 *
277 * @return array
278 */
279 public static function list_layouts() {
280 $status = ! rtsb()->has_pro();
281
282 return apply_filters(
283 'rtsb/elements/elementor/list_layouts',
284 [
285 'list-layout1' => [
286 'title' => esc_html__( 'List Layout 1', 'shopbuilder' ),
287 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-Layout-1.png' ) ),
288 ],
289 'list-layout2' => [
290 'title' => esc_html__( 'List Layout 2', 'shopbuilder' ),
291 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-Layout-2.png' ) ),
292 ],
293 'list-layout3' => [
294 'title' => esc_html__( 'List Layout 3', 'shopbuilder' ),
295 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-3.png' ) ),
296 'is_pro' => $status,
297 ],
298 'list-layout4' => [
299 'title' => esc_html__( 'List Layout 4', 'shopbuilder' ),
300 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-4.png' ) ),
301 'is_pro' => $status,
302 ],
303 'list-layout5' => [
304 'title' => esc_html__( 'List Layout 5', 'shopbuilder' ),
305 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-5.png' ) ),
306 'is_pro' => $status,
307 ],
308 'list-layout6' => [
309 'title' => esc_html__( 'List Layout 6', 'shopbuilder' ),
310 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-6.png' ) ),
311 'is_pro' => $status,
312 ],
313 ]
314 );
315 }
316
317 /**
318 * Category Layouts
319 *
320 * @return array
321 */
322 public static function category_layouts() {
323 $status = ! rtsb()->has_pro();
324
325 return apply_filters(
326 'rtsb/elements/elementor/category_layouts',
327 [
328 'category-layout1' => [
329 'title' => esc_html__( 'Category Layout 1', 'shopbuilder' ),
330 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-1.png' ) ),
331 ],
332
333 'category-layout2' => [
334 'title' => esc_html__( 'Category Layout 2', 'shopbuilder' ),
335 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-2.png' ) ),
336 ],
337 'category-layout3' => [
338 'title' => esc_html__( 'Category Layout 3', 'shopbuilder' ),
339 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-3.png' ) ),
340 'is_pro' => $status,
341 ],
342
343 ]
344 );
345 }
346
347 /**
348 * Category Layouts
349 *
350 * @return array
351 */
352 public static function share_layouts() {
353 $status = ! rtsb()->has_pro();
354
355 return apply_filters(
356 'rtsb/elements/elementor/share_layouts',
357 [
358 'share-layout1' => [
359 'title' => esc_html__( 'Social Share Preset 1', 'shopbuilder' ),
360 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-1.png' ) ),
361 ],
362
363 'share-layout2' => [
364 'title' => esc_html__( 'Social Share Preset 2', 'shopbuilder' ),
365 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-2.png' ) ),
366 ],
367
368 // TODO: Will be activated later.
369 // 'share-layout3' => [
370 // 'title' => esc_html__( 'Social Share Preset 3', 'shopbuilder' ),
371 // 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-1.png' ) ),
372 // 'is_pro' => $status,
373 // ],
374 ]
375 );
376 }
377
378 /**
379 * Action Button Presets
380 *
381 * @return array
382 */
383 public static function action_btn_presets() {
384
385 return apply_filters(
386 'rtsb/elements/elementor/action_btn_presets',
387 [
388 'preset1' => [
389 'title' => esc_html__( 'Preset 1', 'shopbuilder' ),
390 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-1.jpg' ) ),
391 ],
392
393 'preset2' => [
394 'title' => esc_html__( 'Preset 2', 'shopbuilder' ),
395 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-2.jpg' ) ),
396 ],
397
398 'preset3' => [
399 'title' => esc_html__( 'Preset 3', 'shopbuilder' ),
400 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-3.jpg' ) ),
401 ],
402 'preset4' => [
403 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
404 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-4.jpg' ) ),
405 ],
406 'preset5' => [
407 'title' => esc_html__( 'Preset 5', 'shopbuilder' ),
408 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-5.jpg' ) ),
409 'is_pro' => ! rtsb()->has_pro(),
410 ],
411 'preset6' => [
412 'title' => esc_html__( 'Preset 6', 'shopbuilder' ),
413 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-6.jpg' ) ),
414 'is_pro' => ! rtsb()->has_pro(),
415 ],
416 ]
417 );
418 }
419
420 /**
421 * Badge Presets
422 *
423 * @return array
424 */
425 public static function badge_presets() {
426 $status = ! rtsb()->has_pro();
427
428 return apply_filters(
429 'rtsb/elements/elementor/badge_presets',
430 [
431 'preset1' => [
432 'title' => esc_html__( 'Preset 1', 'shopbuilder' ),
433 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ),
434 ],
435
436 'preset2' => [
437 'title' => esc_html__( 'Preset 2', 'shopbuilder' ),
438 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ),
439 ],
440
441 'preset3' => [
442 'title' => esc_html__( 'Preset 3', 'shopbuilder' ),
443 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ),
444 ],
445
446 'preset4' => [
447 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
448 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ),
449 ],
450 ]
451 );
452 }
453
454 /**
455 * Single Category Layouts
456 *
457 * @return array
458 */
459 public static function single_category_layouts() {
460 $status = ! rtsb()->has_pro();
461
462 return apply_filters(
463 'rtsb/elements/elementor/category_single_layouts',
464 [
465 'category-single-layout1' => [
466 'title' => esc_html__( 'Single Category Layout 1', 'shopbuilder' ),
467 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/single-category-1.png' ) ),
468 ],
469
470 'category-single-layout2' => [
471 'title' => esc_html__( 'Single Category Layout 2', 'shopbuilder' ),
472 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/single-category-2.png' ) ),
473 'is_pro' => $status,
474 ],
475 ]
476 );
477 }
478
479 /**
480 * Posts Order By.
481 *
482 * @return array
483 */
484 public static function posts_order_by() {
485 return [
486 'ID' => esc_html__( 'Product ID', 'shopbuilder' ),
487 'title' => esc_html__( 'Product Title', 'shopbuilder' ),
488 'price' => esc_html__( 'Product Price', 'shopbuilder' ),
489 'date' => esc_html__( 'Date', 'shopbuilder' ),
490 'menu_order' => esc_html__( 'Menu Order', 'shopbuilder' ),
491 'rand' => esc_html__( 'Random', 'shopbuilder' ),
492 ];
493 }
494
495 /**
496 * Categories Order By.
497 *
498 * @return array
499 */
500 public static function cats_order_by() {
501 return [
502 'id' => esc_html__( 'Category IDs', 'shopbuilder' ),
503 'name' => esc_html__( 'Category Name', 'shopbuilder' ),
504 'count' => esc_html__( 'Product Count', 'shopbuilder' ),
505 'menu_order' => esc_html__( 'Menu Order', 'shopbuilder' ),
506 ];
507 }
508
509 /**
510 * Posts Order By.
511 *
512 * @return array
513 */
514 public static function posts_order() {
515 return [
516 'ASC' => esc_html__( 'Ascending', 'shopbuilder' ),
517 'DESC' => esc_html__( 'Descending', 'shopbuilder' ),
518 ];
519 }
520
521 /**
522 * Filter products
523 *
524 * @return array
525 */
526 public static function filter_products() {
527 return [
528 'recent' => esc_html__( 'Default', 'shopbuilder' ),
529 'featured' => esc_html__( 'Featured Products', 'shopbuilder' ),
530 'best-selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ),
531 'sale' => esc_html__( 'Sale Products', 'shopbuilder' ),
532 'top-rated' => esc_html__( 'Top Rated Products', 'shopbuilder' ),
533 'recently-viewed' => esc_html__( 'Recently Viewed Products', 'shopbuilder' ),
534 ];
535 }
536
537 /**
538 * Pagination options
539 *
540 * @return array
541 */
542 public static function pagination_options() {
543 return apply_filters(
544 'rtsb/elementor/pagination_options',
545 [
546 'pagination' => esc_html__( 'Number Pagination', 'shopbuilder' ),
547 ]
548 );
549 }
550
551 /**
552 * Heading Tags
553 *
554 * @return array
555 */
556 public static function heading_tags() {
557 return [
558 'h1' => esc_html__( 'H1', 'shopbuilder' ),
559 'h2' => esc_html__( 'H2', 'shopbuilder' ),
560 'h3' => esc_html__( 'H3', 'shopbuilder' ),
561 'h4' => esc_html__( 'H4', 'shopbuilder' ),
562 'h5' => esc_html__( 'H5', 'shopbuilder' ),
563 'h6' => esc_html__( 'H6', 'shopbuilder' ),
564 'p' => esc_html__( 'p', 'shopbuilder' ),
565 'div' => esc_html__( 'div', 'shopbuilder' ),
566 'span' => esc_html__( 'span', 'shopbuilder' ),
567 ];
568 }
569
570 /**
571 * General Style Section
572 *
573 * @param string $id_prefix Section id prefix.
574 * @param string $title Section title.
575 * @param object $obj Reference object.
576 * @param array $condition Condition.
577 * @param array $selectors CSS electors.
578 * @param array $conditions Conditions.
579 *
580 * @return array
581 */
582 public static function general_elementor_style( $id_prefix, $title, $obj, $condition, $selectors, $conditions = [] ) {
583 $prefix = str_replace( ' ', '_', strtolower( $id_prefix ) ) . '_';
584
585 $fields[ $prefix . 'style_section' ] = $obj->start_section(
586 esc_html( $title ),
587 'style',
588 $conditions,
589 $condition
590 );
591
592 $fields[ $prefix . 'typo_note' ] = $obj->el_heading( esc_html__( 'Typography', 'shopbuilder' ), 'default' );
593
594 $fields[ 'rtsb_el_' . $prefix . 'typography' ] = [
595 'mode' => 'group',
596 'type' => 'typography',
597 'selector' => ! empty( $selectors['typography'] ) ? $selectors['typography'] : [],
598 ];
599
600 $fields[ $prefix . 'alignment' ] = [
601 'mode' => 'responsive',
602 'type' => 'choose',
603 'label' => esc_html__( 'Alignment', 'shopbuilder' ),
604 'options' => [
605 'left' => [
606 'title' => esc_html__( 'Left', 'shopbuilder' ),
607 'icon' => 'eicon-text-align-left',
608 ],
609 'center' => [
610 'title' => esc_html__( 'Center', 'shopbuilder' ),
611 'icon' => 'eicon-text-align-center',
612 ],
613 'right' => [
614 'title' => esc_html__( 'Right', 'shopbuilder' ),
615 'icon' => 'eicon-text-align-right',
616 ],
617 ],
618 'selectors' => ! empty( $selectors['alignment'] ) ? $selectors['alignment'] : [],
619 ];
620
621 $fields[ $prefix . 'color_note' ] = $obj->el_heading( esc_html__( 'Colors', 'shopbuilder' ), 'before' );
622
623 $fields[ $prefix . 'color_tabs' ] = $obj->start_tab_group();
624 $fields[ $prefix . 'color_tab' ] = $obj->start_tab( esc_html__( 'Normal', 'shopbuilder' ) );
625
626 $fields[ $prefix . 'color' ] = [
627 'type' => 'color',
628 'label' => esc_html__( 'Color', 'shopbuilder' ),
629 'selectors' => ! empty( $selectors['color'] ) ? $selectors['color'] : [],
630 'separator' => 'default',
631 ];
632
633 $fields[ $prefix . 'bg_color' ] = [
634 'type' => 'color',
635 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
636 'selectors' => ! empty( $selectors['bg_color'] ) ? $selectors['bg_color'] : [],
637 'separator' => 'default',
638 ];
639
640 $fields[ $prefix . 'color_tab_end' ] = $obj->end_tab();
641 $fields[ $prefix . 'hover_color_tab' ] = $obj->start_tab( esc_html__( 'Hover', 'shopbuilder' ) );
642
643 $fields[ $prefix . 'hover_color' ] = [
644 'type' => 'color',
645 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
646 'selectors' => ! empty( $selectors['hover_color'] ) ? $selectors['hover_color'] : [],
647 'separator' => 'default',
648 ];
649
650 $fields[ $prefix . 'hover_bg_color' ] = [
651 'type' => 'color',
652 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
653 'selectors' => ! empty( $selectors['hover_bg_color'] ) ? $selectors['hover_bg_color'] : [],
654 'separator' => 'default',
655 ];
656
657 $fields[ $prefix . 'hover_color_tab_end' ] = $obj->end_tab();
658 $fields[ $prefix . 'color_tabs_end' ] = $obj->end_tab_group();
659
660 $fields[ $prefix . 'border_note' ] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' );
661
662 $fields[ 'rtsb_el_' . $prefix . 'border' ] = [
663 'mode' => 'group',
664 'type' => 'border',
665 'label' => esc_html__( 'Border', 'shopbuilder' ),
666 'selector' => ! empty( $selectors['border'] ) ? $selectors['border'] : [],
667 'fields_options' => [
668 'color' => [
669 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
670 ],
671 ],
672 'separator' => 'default',
673 ];
674
675 $fields[ $prefix . 'border_hover_color' ] = [
676 'type' => 'color',
677 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
678 'condition' => [ 'rtsb_el_' . $prefix . 'border_border!' => [ '' ] ],
679 'selectors' => ! empty( $selectors['border_hover_color'] ) ? $selectors['border_hover_color'] : [],
680 'separator' => 'default',
681 ];
682
683 $fields[ $prefix . 'spacing_note' ] = $obj->el_heading( esc_html__( 'Spacing', 'shopbuilder' ), 'before' );
684
685 $fields[ $prefix . 'padding' ] = [
686 'mode' => 'responsive',
687 'type' => 'dimensions',
688 'label' => esc_html__( 'Padding', 'shopbuilder' ),
689 'size_units' => [ 'px', '%', 'em' ],
690 'selectors' => ! empty( $selectors['padding'] ) ? $selectors['padding'] : [],
691 'separator' => 'default',
692 ];
693
694 $fields[ $prefix . 'margin' ] = [
695 'mode' => 'responsive',
696 'type' => 'dimensions',
697 'label' => esc_html__( 'Margin', 'shopbuilder' ),
698 'size_units' => [ 'px', '%', 'em' ],
699 'selectors' => ! empty( $selectors['margin'] ) ? $selectors['margin'] : [],
700 ];
701
702 $fields[ $prefix . 'style_section_end' ] = $obj->end_section();
703
704 return $fields;
705 }
706
707 /**
708 * Sharing Settings.
709 *
710 * @return array
711 */
712 public static function sharing_settings() {
713 $settings = get_option( 'rtsb_settings' );
714 $share_settings = ! empty( $settings['general']['social_share']['share_platforms'] ) ? $settings['general']['social_share']['share_platforms'] : [];
715
716 return ! empty( $share_settings ) && is_array( $share_settings ) ? $share_settings : [ 'facebook', 'twitter' ];
717 }
718 }
719