PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.1.0
ShopBuilder – WooCommerce Builder For Elementor v2.1.0
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.0, at app/Elementor/Helper/ControlHelper.php

694 lines 20.3 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
134 ]
135 );
136 }
137
138 /**
139 * Single Product Tab Layouts
140 *
141 * @return array
142 */
143 public static function single_product_tab_layouts() {
144 $status = ! rtsb()->has_pro();
145
146 return apply_filters(
147 'rtsb/elements/elementor/single_product_tab_layouts',
148 [
149 'default' => [
150 'title' => esc_html__( 'Default Layout', 'shopbuilder' ),
151 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-01.png' ) ),
152 ],
153 'custom-layout1' => [
154 'title' => esc_html__( 'Accordion Layout', 'shopbuilder' ),
155 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-02.png' ) ),
156 'is_pro' => $status,
157 ],
158 'custom-layout2' => [
159 'title' => esc_html__( 'Tab Layout', 'shopbuilder' ),
160 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-03.png' ) ),
161 'is_pro' => $status,
162 ],
163 ]
164 );
165 }
166
167 /**
168 * Single Advanced Product Tab Layouts
169 *
170 * @return array
171 */
172 public static function single_advanced_product_tab_layouts() {
173
174 return apply_filters(
175 'rtsb/elements/elementor/single_advanced_product_tab_layouts',
176 [
177 'default' => [
178 'title' => esc_html__( 'Default Layout', 'shopbuilder' ),
179 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-01.png' ) ),
180 ],
181 'custom-layout1' => [
182 'title' => esc_html__( 'Accordion Layout', 'shopbuilder' ),
183 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-02.png' ) ),
184 ],
185 'custom-layout2' => [
186 'title' => esc_html__( 'Tab Layout', 'shopbuilder' ),
187 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-03.png' ) ),
188 ],
189 ]
190 );
191 }
192
193 /**
194 * Slider Layouts
195 *
196 * @return array
197 */
198 public static function slider_layouts() {
199 $status = ! rtsb()->has_pro();
200
201 return apply_filters(
202 'rtsb/elements/elementor/slider_layouts',
203 [
204 'slider-layout1' => [
205 'title' => esc_html__( 'Slider Layout 1', 'shopbuilder' ),
206 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-1.png' ) ),
207 ],
208
209 'slider-layout2' => [
210 'title' => esc_html__( 'Slider Layout 2', 'shopbuilder' ),
211 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-2.png' ) ),
212 ],
213
214 'slider-layout3' => [
215 'title' => esc_html__( 'Slider Layout 3', 'shopbuilder' ),
216 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-3.png' ) ),
217 'is_pro' => $status,
218 ],
219
220 'slider-layout4' => [
221 'title' => esc_html__( 'Slider Layout 4', 'shopbuilder' ),
222 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-4.png' ) ),
223 'is_pro' => $status,
224 ],
225 'slider-layout5' => [
226 'title' => esc_html__( 'Slider Layout 5', 'shopbuilder' ),
227 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-5.png' ) ),
228 'is_pro' => $status,
229 ],
230 'slider-layout6' => [
231 'title' => esc_html__( 'Slider Layout 6', 'shopbuilder' ),
232 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-6.png' ) ),
233 'is_pro' => $status,
234 ],
235 'slider-layout7' => [
236 'title' => esc_html__( 'Slider Layout 7', 'shopbuilder' ),
237 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-7.png' ) ),
238 'is_pro' => $status,
239 ],
240 'slider-layout8' => [
241 'title' => esc_html__( 'Slider Layout 8', 'shopbuilder' ),
242 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-6.png' ) ),
243 'is_pro' => $status,
244 ],
245 ]
246 );
247 }
248
249 /**
250 * List Layouts
251 *
252 * @return array
253 */
254 public static function list_layouts() {
255 $status = ! rtsb()->has_pro();
256
257 return apply_filters(
258 'rtsb/elements/elementor/list_layouts',
259 [
260 'list-layout1' => [
261 'title' => esc_html__( 'List Layout 1', 'shopbuilder' ),
262 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-Layout-1.png' ) ),
263 ],
264 'list-layout2' => [
265 'title' => esc_html__( 'List Layout 2', 'shopbuilder' ),
266 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-Layout-2.png' ) ),
267 ],
268 'list-layout3' => [
269 'title' => esc_html__( 'List Layout 3', 'shopbuilder' ),
270 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-3.png' ) ),
271 'is_pro' => $status,
272 ],
273 'list-layout4' => [
274 'title' => esc_html__( 'List Layout 4', 'shopbuilder' ),
275 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-4.png' ) ),
276 'is_pro' => $status,
277 ],
278 'list-layout5' => [
279 'title' => esc_html__( 'List Layout 5', 'shopbuilder' ),
280 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-5.png' ) ),
281 'is_pro' => $status,
282 ],
283 'list-layout6' => [
284 'title' => esc_html__( 'List Layout 6', 'shopbuilder' ),
285 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-6.png' ) ),
286 'is_pro' => $status,
287 ],
288 ]
289 );
290 }
291
292 /**
293 * Category Layouts
294 *
295 * @return array
296 */
297 public static function category_layouts() {
298 $status = ! rtsb()->has_pro();
299
300 return apply_filters(
301 'rtsb/elements/elementor/category_layouts',
302 [
303 'category-layout1' => [
304 'title' => esc_html__( 'Category Layout 1', 'shopbuilder' ),
305 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-1.png' ) ),
306 ],
307
308 'category-layout2' => [
309 'title' => esc_html__( 'Category Layout 2', 'shopbuilder' ),
310 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-2.png' ) ),
311 ],
312 'category-layout3' => [
313 'title' => esc_html__( 'Category Layout 3', 'shopbuilder' ),
314 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-3.png' ) ),
315 'is_pro' => $status,
316 ],
317
318 ]
319 );
320 }
321
322 /**
323 * Category Layouts
324 *
325 * @return array
326 */
327 public static function share_layouts() {
328 $status = ! rtsb()->has_pro();
329
330 return apply_filters(
331 'rtsb/elements/elementor/share_layouts',
332 [
333 'share-layout1' => [
334 'title' => esc_html__( 'Social Share Preset 1', 'shopbuilder' ),
335 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-1.png' ) ),
336 ],
337
338 'share-layout2' => [
339 'title' => esc_html__( 'Social Share Preset 2', 'shopbuilder' ),
340 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-2.png' ) ),
341 ],
342
343 // TODO: Will be activated later.
344 // 'share-layout3' => [
345 // 'title' => esc_html__( 'Social Share Preset 3', 'shopbuilder' ),
346 // 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-1.png' ) ),
347 // 'is_pro' => $status,
348 // ],
349 ]
350 );
351 }
352
353 /**
354 * Action Button Presets
355 *
356 * @return array
357 */
358 public static function action_btn_presets() {
359
360 return apply_filters(
361 'rtsb/elements/elementor/action_btn_presets',
362 [
363 'preset1' => [
364 'title' => esc_html__( 'Preset 1', 'shopbuilder' ),
365 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-1.jpg' ) ),
366 ],
367
368 'preset2' => [
369 'title' => esc_html__( 'Preset 2', 'shopbuilder' ),
370 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-2.jpg' ) ),
371 ],
372
373 'preset3' => [
374 'title' => esc_html__( 'Preset 3', 'shopbuilder' ),
375 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-3.jpg' ) ),
376 ],
377 'preset4' => [
378 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
379 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-4.jpg' ) ),
380 ],
381 'preset5' => [
382 'title' => esc_html__( 'Preset 5', 'shopbuilder' ),
383 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-5.jpg' ) ),
384 'is_pro' => ! rtsb()->has_pro(),
385 ],
386 'preset6' => [
387 'title' => esc_html__( 'Preset 6', 'shopbuilder' ),
388 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-6.jpg' ) ),
389 'is_pro' => ! rtsb()->has_pro(),
390 ],
391 ]
392 );
393 }
394
395 /**
396 * Badge Presets
397 *
398 * @return array
399 */
400 public static function badge_presets() {
401 $status = ! rtsb()->has_pro();
402
403 return apply_filters(
404 'rtsb/elements/elementor/badge_presets',
405 [
406 'preset1' => [
407 'title' => esc_html__( 'Preset 1', 'shopbuilder' ),
408 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ),
409 ],
410
411 'preset2' => [
412 'title' => esc_html__( 'Preset 2', 'shopbuilder' ),
413 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ),
414 ],
415
416 'preset3' => [
417 'title' => esc_html__( 'Preset 3', 'shopbuilder' ),
418 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ),
419 ],
420
421 'preset4' => [
422 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
423 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ),
424 ],
425 ]
426 );
427 }
428
429 /**
430 * Single Category Layouts
431 *
432 * @return array
433 */
434 public static function single_category_layouts() {
435 $status = ! rtsb()->has_pro();
436
437 return apply_filters(
438 'rtsb/elements/elementor/category_single_layouts',
439 [
440 'category-single-layout1' => [
441 'title' => esc_html__( 'Single Category Layout 1', 'shopbuilder' ),
442 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/single-category-1.png' ) ),
443 ],
444
445 'category-single-layout2' => [
446 'title' => esc_html__( 'Single Category Layout 2', 'shopbuilder' ),
447 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/single-category-2.png' ) ),
448 'is_pro' => $status,
449 ],
450 ]
451 );
452 }
453
454 /**
455 * Posts Order By.
456 *
457 * @return array
458 */
459 public static function posts_order_by() {
460 return [
461 'ID' => esc_html__( 'Product ID', 'shopbuilder' ),
462 'title' => esc_html__( 'Product Title', 'shopbuilder' ),
463 'price' => esc_html__( 'Product Price', 'shopbuilder' ),
464 'date' => esc_html__( 'Date', 'shopbuilder' ),
465 'menu_order' => esc_html__( 'Menu Order', 'shopbuilder' ),
466 'rand' => esc_html__( 'Random', 'shopbuilder' ),
467 ];
468 }
469
470 /**
471 * Categories Order By.
472 *
473 * @return array
474 */
475 public static function cats_order_by() {
476 return [
477 'id' => esc_html__( 'Category IDs', 'shopbuilder' ),
478 'name' => esc_html__( 'Category Name', 'shopbuilder' ),
479 'count' => esc_html__( 'Product Count', 'shopbuilder' ),
480 'menu_order' => esc_html__( 'Menu Order', 'shopbuilder' ),
481 ];
482 }
483
484 /**
485 * Posts Order By.
486 *
487 * @return array
488 */
489 public static function posts_order() {
490 return [
491 'ASC' => esc_html__( 'Ascending', 'shopbuilder' ),
492 'DESC' => esc_html__( 'Descending', 'shopbuilder' ),
493 ];
494 }
495
496 /**
497 * Filter products
498 *
499 * @return array
500 */
501 public static function filter_products() {
502 return [
503 'recent' => esc_html__( 'Default', 'shopbuilder' ),
504 'featured' => esc_html__( 'Featured Products', 'shopbuilder' ),
505 'best-selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ),
506 'sale' => esc_html__( 'Sale Products', 'shopbuilder' ),
507 'top-rated' => esc_html__( 'Top Rated Products', 'shopbuilder' ),
508 'recently-viewed' => esc_html__( 'Recently Viewed Products', 'shopbuilder' ),
509 ];
510 }
511
512 /**
513 * Pagination options
514 *
515 * @return array
516 */
517 public static function pagination_options() {
518 return apply_filters(
519 'rtsb/elementor/pagination_options',
520 [
521 'pagination' => esc_html__( 'Number Pagination', 'shopbuilder' ),
522 ]
523 );
524 }
525
526 /**
527 * Heading Tags
528 *
529 * @return array
530 */
531 public static function heading_tags() {
532 return [
533 'h1' => esc_html__( 'H1', 'shopbuilder' ),
534 'h2' => esc_html__( 'H2', 'shopbuilder' ),
535 'h3' => esc_html__( 'H3', 'shopbuilder' ),
536 'h4' => esc_html__( 'H4', 'shopbuilder' ),
537 'h5' => esc_html__( 'H5', 'shopbuilder' ),
538 'h6' => esc_html__( 'H6', 'shopbuilder' ),
539 'p' => esc_html__( 'p', 'shopbuilder' ),
540 'div' => esc_html__( 'div', 'shopbuilder' ),
541 'span' => esc_html__( 'span', 'shopbuilder' ),
542 ];
543 }
544
545 /**
546 * General Style Section
547 *
548 * @param string $id_prefix Section id prefix.
549 * @param string $title Section title.
550 * @param object $obj Reference object.
551 * @param array $condition Condition.
552 * @param array $selectors CSS electors.
553 * @param array $conditions Conditions.
554 *
555 * @return array
556 */
557 public static function general_elementor_style( $id_prefix, $title, $obj, $condition, $selectors, $conditions = [] ) {
558 $prefix = str_replace( ' ', '_', strtolower( $id_prefix ) ) . '_';
559
560 $fields[ $prefix . 'style_section' ] = $obj->start_section(
561 esc_html( $title ),
562 'style',
563 $conditions,
564 $condition
565 );
566
567 $fields[ $prefix . 'typo_note' ] = $obj->el_heading( esc_html__( 'Typography', 'shopbuilder' ), 'default' );
568
569 $fields[ 'rtsb_el_' . $prefix . 'typography' ] = [
570 'mode' => 'group',
571 'type' => 'typography',
572 'selector' => ! empty( $selectors['typography'] ) ? $selectors['typography'] : [],
573 ];
574
575 $fields[ $prefix . 'alignment' ] = [
576 'mode' => 'responsive',
577 'type' => 'choose',
578 'label' => esc_html__( 'Alignment', 'shopbuilder' ),
579 'options' => [
580 'left' => [
581 'title' => esc_html__( 'Left', 'shopbuilder' ),
582 'icon' => 'eicon-text-align-left',
583 ],
584 'center' => [
585 'title' => esc_html__( 'Center', 'shopbuilder' ),
586 'icon' => 'eicon-text-align-center',
587 ],
588 'right' => [
589 'title' => esc_html__( 'Right', 'shopbuilder' ),
590 'icon' => 'eicon-text-align-right',
591 ],
592 ],
593 'selectors' => ! empty( $selectors['alignment'] ) ? $selectors['alignment'] : [],
594 ];
595
596 $fields[ $prefix . 'color_note' ] = $obj->el_heading( esc_html__( 'Colors', 'shopbuilder' ), 'before' );
597
598 $fields[ $prefix . 'color_tabs' ] = $obj->start_tab_group();
599 $fields[ $prefix . 'color_tab' ] = $obj->start_tab( esc_html__( 'Normal', 'shopbuilder' ) );
600
601 $fields[ $prefix . 'color' ] = [
602 'type' => 'color',
603 'label' => esc_html__( 'Color', 'shopbuilder' ),
604 'selectors' => ! empty( $selectors['color'] ) ? $selectors['color'] : [],
605 'separator' => 'default',
606 ];
607
608 $fields[ $prefix . 'bg_color' ] = [
609 'type' => 'color',
610 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
611 'selectors' => ! empty( $selectors['bg_color'] ) ? $selectors['bg_color'] : [],
612 'separator' => 'default',
613 ];
614
615 $fields[ $prefix . 'color_tab_end' ] = $obj->end_tab();
616 $fields[ $prefix . 'hover_color_tab' ] = $obj->start_tab( esc_html__( 'Hover', 'shopbuilder' ) );
617
618 $fields[ $prefix . 'hover_color' ] = [
619 'type' => 'color',
620 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
621 'selectors' => ! empty( $selectors['hover_color'] ) ? $selectors['hover_color'] : [],
622 'separator' => 'default',
623 ];
624
625 $fields[ $prefix . 'hover_bg_color' ] = [
626 'type' => 'color',
627 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
628 'selectors' => ! empty( $selectors['hover_bg_color'] ) ? $selectors['hover_bg_color'] : [],
629 'separator' => 'default',
630 ];
631
632 $fields[ $prefix . 'hover_color_tab_end' ] = $obj->end_tab();
633 $fields[ $prefix . 'color_tabs_end' ] = $obj->end_tab_group();
634
635 $fields[ $prefix . 'border_note' ] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' );
636
637 $fields[ 'rtsb_el_' . $prefix . 'border' ] = [
638 'mode' => 'group',
639 'type' => 'border',
640 'label' => esc_html__( 'Border', 'shopbuilder' ),
641 'selector' => ! empty( $selectors['border'] ) ? $selectors['border'] : [],
642 'fields_options' => [
643 'color' => [
644 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
645 ],
646 ],
647 'separator' => 'default',
648 ];
649
650 $fields[ $prefix . 'border_hover_color' ] = [
651 'type' => 'color',
652 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
653 'condition' => [ 'rtsb_el_' . $prefix . 'border_border!' => [ '' ] ],
654 'selectors' => ! empty( $selectors['border_hover_color'] ) ? $selectors['border_hover_color'] : [],
655 'separator' => 'default',
656 ];
657
658 $fields[ $prefix . 'spacing_note' ] = $obj->el_heading( esc_html__( 'Spacing', 'shopbuilder' ), 'before' );
659
660 $fields[ $prefix . 'padding' ] = [
661 'mode' => 'responsive',
662 'type' => 'dimensions',
663 'label' => esc_html__( 'Padding', 'shopbuilder' ),
664 'size_units' => [ 'px', '%', 'em' ],
665 'selectors' => ! empty( $selectors['padding'] ) ? $selectors['padding'] : [],
666 'separator' => 'default',
667 ];
668
669 $fields[ $prefix . 'margin' ] = [
670 'mode' => 'responsive',
671 'type' => 'dimensions',
672 'label' => esc_html__( 'Margin', 'shopbuilder' ),
673 'size_units' => [ 'px', '%', 'em' ],
674 'selectors' => ! empty( $selectors['margin'] ) ? $selectors['margin'] : [],
675 ];
676
677 $fields[ $prefix . 'style_section_end' ] = $obj->end_section();
678
679 return $fields;
680 }
681
682 /**
683 * Sharing Settings.
684 *
685 * @return array
686 */
687 public static function sharing_settings() {
688 $settings = get_option( 'rtsb_settings' );
689 $share_settings = ! empty( $settings['general']['social_share']['share_platforms'] ) ? $settings['general']['social_share']['share_platforms'] : [];
690
691 return ! empty( $share_settings ) && is_array( $share_settings ) ? $share_settings : [ 'facebook', 'twitter' ];
692 }
693 }
694