PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.6.0
ShopBuilder – WooCommerce Builder For Elementor v2.6.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 / PostHelpers.php

PostHelpers.php in ShopBuilder – WooCommerce Builder For Elementor 2.6.0, at app/Elementor/Helper/PostHelpers.php

1,257 lines 47.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace RadiusTheme\SB\Elementor\Helper;
4
5 // Do not allow directly accessing this file.
6 use RadiusTheme\SB\Elementor\Helper\ControlHelper;
7 use RadiusTheme\SB\Elementor\Helper\RenderHelpers;
8 use RadiusTheme\SB\Elementor\Widgets\Controls\StyleFields as StyleFieldsFree;
9 use RadiusTheme\SB\Helpers\Fns;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit( 'This script cannot be accessed directly.' );
13 }
14 class PostHelpers {
15 /**
16 * Query section
17 *
18 * @param object $obj Reference object.
19 *
20 * @return array
21 */
22 public static function query( $obj ) {
23 $fields['query_section'] = $obj->start_section(
24 esc_html__( 'Query', 'shopbuilder' ),
25 'content'
26 );
27
28 $fields['query_note'] = $obj->el_heading( esc_html__( 'Common Filters', 'shopbuilder' ) );
29
30 $fields['include_posts'] = [
31 'type' => 'rt-select2',
32 'label' => esc_html__( 'Include Post', 'shopbuilder' ),
33 'description' => esc_html__( 'Please select the products to show. Leave it blank to include all products.', 'shopbuilder' ),
34 'source_name' => 'post_type',
35 'source_type' => 'post',
36 'multiple' => true,
37 'label_block' => true,
38 ];
39
40 $fields['exclude_posts'] = [
41 'type' => 'rt-select2',
42 'label' => esc_html__( 'Exclude Post', 'shopbuilder' ),
43 'description' => esc_html__( 'Please select the products to show. Leave it blank to exclude none.', 'shopbuilder' ),
44 'source_name' => 'post_type',
45 'source_type' => 'post',
46 'multiple' => true,
47 'label_block' => true,
48 ];
49
50 $fields['posts_limit'] = [
51 'type' => 'number',
52 'label' => esc_html__( 'Posts Limit', 'shopbuilder' ),
53 'description' => esc_html__( 'The number of products to show. Set empty to show all products.', 'shopbuilder' ),
54 'default' => 12,
55 ];
56
57 $fields['posts_offset'] = [
58 'type' => 'number',
59 'label' => esc_html__( 'Posts Offset', 'shopbuilder' ),
60 'description' => esc_html__( 'Number of products to skip.', 'shopbuilder' ),
61 ];
62
63 $fields['category_note'] = $obj->el_heading( esc_html__( 'Taxonomy Filters', 'shopbuilder' ), 'before' );
64
65 $fields['filter_categories'] = [
66 'type' => 'rt-select2',
67 'label' => esc_html__( 'Filter By Categories', 'shopbuilder' ),
68 'description' => esc_html__( 'Select the categories you want to filter, Leave it blank for all categories.', 'shopbuilder' ),
69 'source_name' => 'taxonomy',
70 'source_type' => 'category',
71 'multiple' => true,
72 'label_block' => true,
73 'minimum_input_length' => 1,
74 ];
75
76 $fields['filter_tags'] = [
77 'type' => 'rt-select2',
78 'label' => esc_html__( 'Filter By Tags', 'shopbuilder' ),
79 'description' => esc_html__( 'Select the tags you want to filter, Leave it blank for all tags.', 'shopbuilder' ),
80 'source_name' => 'taxonomy',
81 'source_type' => 'post_tag',
82 'multiple' => true,
83 'label_block' => true,
84 'minimum_input_length' => 1,
85 ];
86
87 $fields['tax_relation'] = [
88 'type' => 'select2',
89 'label' => esc_html__( 'Taxonomy relation', 'shopbuilder' ),
90 'options' => [
91 'OR' => 'Show All Products (OR)',
92 'AND' => 'Show Common Products (AND)',
93 ],
94 'default' => 'AND',
95 'description' => esc_html__( 'Select the taxonomies relationship. It is applicable if you select more than one taxonomy.', 'shopbuilder' ),
96 'label_block' => true,
97 ];
98
99 $fields['sorting_note'] = $obj->el_heading( esc_html__( 'Sorting', 'shopbuilder' ), 'before' );
100
101 $fields['posts_order_by'] = [
102 'type' => 'select2',
103 'label' => esc_html__( 'Order By', 'shopbuilder' ),
104 'options' => ControlHelper::posts_order_by(),
105 'default' => 'date',
106 ];
107
108 $fields['posts_order'] = [
109 'type' => 'select2',
110 'label' => esc_html__( 'Order', 'shopbuilder' ),
111 'options' => ControlHelper::posts_order(),
112 'default' => 'DESC',
113 ];
114
115 $fields['query_section_end'] = $obj->end_section();
116
117 return apply_filters( 'rtsb/elements/elementor/query_control', $fields, $obj );
118 }
119 /**
120 * Pagination section
121 *
122 * @param object $obj Reference object.
123 *
124 * @return array
125 */
126 public static function pagination( $obj ) {
127 $fields['pagination_section'] = $obj->start_section(
128 esc_html__( 'Pagination', 'shopbuilder' ),
129 'content',
130 );
131
132 $fields['show_pagination'] = [
133 'type' => 'switch',
134 'label' => esc_html__( 'Enable Pagination?', 'shopbuilder' ),
135 'description' => esc_html__( 'Switch on to enable pagination.', 'shopbuilder' ),
136 'label_on' => esc_html__( 'On', 'shopbuilder' ),
137 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
138 ];
139
140 $fields['pagination_per_page'] = [
141 'type' => 'number',
142 'label' => esc_html__( 'Number of Posts Per Page', 'shopbuilder' ),
143 'default' => 8,
144 'description' => esc_html__( 'Please enter the number of products per page to show.', 'shopbuilder' ),
145 'condition' => [ 'show_pagination' => [ 'yes' ] ],
146 ];
147
148 $fields['pagination_section_end'] = $obj->end_section();
149
150 return apply_filters( 'rtsb/elementor/post_pagination_control', $fields, $obj );
151 }
152 /**
153 * Visibility section
154 *
155 * @param object $obj Reference object.
156 *
157 * @return array
158 */
159 public static function content_visibility( $obj ) {
160 $fields['visibility_section'] = $obj->start_section(
161 esc_html__( 'Content Visibility', 'shopbuilder' ),
162 'settings'
163 );
164 $fields['show_title'] = [
165 'type' => 'switch',
166 'label' => esc_html__( 'Show Post Title?', 'shopbuilder' ),
167 'description' => esc_html__( 'Switch on to show post title.', 'shopbuilder' ),
168 'label_on' => esc_html__( 'On', 'shopbuilder' ),
169 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
170 'default' => 'yes',
171 ];
172 $fields['show_post_thumbnail'] = [
173 'type' => 'switch',
174 'label' => esc_html__( 'Show Post Thumbnail?', 'shopbuilder' ),
175 'description' => esc_html__( 'Switch on to show post thumbnail.', 'shopbuilder' ),
176 'label_on' => esc_html__( 'On', 'shopbuilder' ),
177 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
178 'default' => 'yes',
179 ];
180 $fields['show_short_desc'] = [
181 'type' => 'switch',
182 'label' => esc_html__( 'Show Short Description?', 'shopbuilder' ),
183 'description' => esc_html__( 'Switch on to show post short description.', 'shopbuilder' ),
184 'label_on' => esc_html__( 'On', 'shopbuilder' ),
185 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
186 'default' => 'yes',
187 ];
188
189 $fields['show_categories'] = [
190 'type' => 'switch',
191 'label' => esc_html__( 'Show Post Categories?', 'shopbuilder' ),
192 'description' => esc_html__( 'Switch on to show product categories.', 'shopbuilder' ),
193 'label_on' => esc_html__( 'On', 'shopbuilder' ),
194 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
195 'default' => 'yes',
196 ];
197 $fields['show_tags'] = [
198 'type' => 'switch',
199 'label' => esc_html__( 'Show Post Tags?', 'shopbuilder' ),
200 'description' => esc_html__( 'Switch on to show product categories.', 'shopbuilder' ),
201 'label_on' => esc_html__( 'On', 'shopbuilder' ),
202 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
203 ];
204 $fields['show_dates'] = [
205 'type' => 'switch',
206 'label' => esc_html__( 'Show Post Dates', 'shopbuilder' ),
207 'description' => esc_html__( 'Switch on to show post dates.', 'shopbuilder' ),
208 'label_on' => esc_html__( 'On', 'shopbuilder' ),
209 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
210 'default' => 'yes',
211 ];
212 $fields['show_author'] = [
213 'type' => 'switch',
214 'label' => esc_html__( 'Show Post Author', 'shopbuilder' ),
215 'description' => esc_html__( 'Switch on to show post author.', 'shopbuilder' ),
216 'label_on' => esc_html__( 'On', 'shopbuilder' ),
217 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
218 'default' => 'yes',
219 ];
220 $fields['show_read_more_btn'] = [
221 'type' => 'switch',
222 'label' => esc_html__( 'Show Read More Button', 'shopbuilder' ),
223 'description' => esc_html__( 'Switch on to show post read more button.', 'shopbuilder' ),
224 'label_on' => esc_html__( 'On', 'shopbuilder' ),
225 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
226 'default' => 'yes',
227 ];
228
229 $fields['visibility_section_end'] = $obj->end_section();
230
231 return apply_filters( 'rtsb/elements/elementor/posts_visibility_control', $fields, $obj );
232 }
233 /**
234 * Image section
235 *
236 * @param object $obj Reference object.
237 *
238 * @return array
239 */
240 public static function image( $obj ) {
241 $condition = [
242 'show_post_thumbnail' => 'yes',
243 ];
244 $fields['image_section'] = $obj->start_section(
245 esc_html__( 'Images', 'shopbuilder' ),
246 'settings',
247 [],
248 $condition
249 );
250 $fields['image_hover_effect'] = [
251 'type' => 'select',
252 'label' => esc_html__( 'Image Hover Effect', 'shopbuilder' ),
253 'options' => self::rtsb_post_image_hover_effect(),
254 'default' => 'rtsb-gw-img-zoom-out',
255 'label_block' => true,
256 ];
257 $fields['image_size_note'] = $obj->el_heading(
258 esc_html__( 'Image Size', 'shopbuilder' ),
259 'before',
260 [],
261 [ 'show_post_thumbnail' => [ 'yes' ] ]
262 );
263 $fields['image_size'] = [
264 'type' => 'select2',
265 'label' => esc_html__( 'Select Image Size', 'shopbuilder' ),
266 'description' => esc_html__( 'Please select the image size.', 'shopbuilder' ),
267 'options' => Fns::get_image_sizes(),
268 'default' => 'full',
269 'label_block' => true,
270 'content_classes' => 'elementor-descriptor',
271 ];
272 $fields['img_dimension'] = [
273 'type' => 'image-dimensions',
274 'label' => esc_html__( 'Enter Custom Image Size', 'shopbuilder' ),
275 'label_block' => true,
276 'default' => [
277 'width' => 400,
278 'height' => 400,
279 ],
280 'condition' => [
281 'image_size' => 'rtsb_custom',
282 ],
283 ];
284 $fields['img_crop'] = [
285 'type' => 'select2',
286 'label' => esc_html__( 'Image Crop', 'shopbuilder' ),
287 'description' => esc_html__( 'Please click on "Apply" to update the image.', 'shopbuilder' ),
288 'options' => [
289 'soft' => esc_html__( 'Soft Crop', 'shopbuilder' ),
290 'hard' => esc_html__( 'Hard Crop', 'shopbuilder' ),
291 ],
292 'default' => 'hard',
293 'condition' => [
294 'image_size' => 'rtsb_custom',
295 ],
296 ];
297 $fields['img_custom_dimension_note'] = [
298 'type' => 'html',
299 'raw' => sprintf(
300 '<span style="display: block; background: #fffbf1; padding: 10px; font-weight: 500; line-height: 1.4; color: #bd3a3a;border: 1px solid #bd3a3a;">%s</span>',
301 esc_html__( 'Please note that, if you enter image size larger than the actual image itself, the image sizes will fallback to the full image dimension.', 'shopbuilder' )
302 ),
303 'condition' => [
304 'image_size' => 'rtsb_custom',
305 ],
306
307 ];
308 $fields['image_section_end'] = $obj->end_section();
309
310 return $fields;
311 }
312 /**
313 * Button section
314 *
315 * @param object $obj Reference object.
316 *
317 * @return array
318 */
319 public static function readmore_button( $obj ) {
320 $condition = [
321 'show_read_more_btn' => 'yes',
322 ];
323 $fields['button_section'] = $obj->start_section(
324 esc_html__( 'Read More Button', 'shopbuilder' ),
325 'settings',
326 [],
327 $condition
328 );
329 $fields['button_icon'] = [
330 'label' => esc_html__( 'Button Icon', 'shopbuilder' ),
331 'type' => 'icons',
332 'default' => [
333 'value' => 'fas fa-arrow-right',
334 'library' => 'fa-solid',
335 ],
336 ];
337 $fields['button_icon_position'] = [
338 'mode' => 'responsive',
339 'type' => 'choose',
340 'label' => esc_html__( 'Position', 'shopbuilder' ),
341 'options' => [
342 'left' => [
343 'title' => esc_html__( 'Left', 'shopbuilder' ),
344 'icon' => 'eicon-h-align-left',
345 ],
346 'right' => [
347 'title' => esc_html__( 'Right', 'shopbuilder' ),
348 'icon' => 'eicon-h-align-right',
349 ],
350
351 ],
352 'toggle' => true,
353 'default' => 'right',
354 ];
355 $fields['button_text'] = [
356 'label' => esc_html__( 'Button Text', 'shopbuilder' ),
357 'description' => esc_html__( 'Please enter the button text.', 'shopbuilder' ),
358 'type' => 'text',
359 'label_block' => true,
360 'default' => __( 'Read More', 'shopbuilder' ),
361 ];
362 $fields['button_section_end'] = $obj->end_section();
363
364 return $fields;
365 }
366 /**
367 * Title section
368 *
369 * @param object $obj Reference object.
370 *
371 * @return array
372 */
373 public static function post_title( $obj ) {
374 $condition = [
375 'show_title' => [ 'yes' ],
376 ];
377
378 $fields['post_title_section'] = $obj->start_section(
379 esc_html__( 'Title', 'shopbuilder' ),
380 'settings',
381 [],
382 $condition
383 );
384
385 $fields['title_tag'] = [
386 'type' => 'select2',
387 'label' => esc_html__( 'Post Title Tag', 'shopbuilder' ),
388 'options' => ControlHelper::heading_tags(),
389 'label_block' => true,
390 'default' => 'h3',
391 'description' => esc_html__( 'Please select the post title tag.', 'shopbuilder' ),
392 ];
393 $fields['title_limit'] = [
394 'type' => 'select2',
395 'label' => esc_html__( 'Post Title Limit', 'shopbuilder' ),
396 'options' => [
397 'default' => esc_html__( 'Default', 'shopbuilder' ),
398 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
399 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
400 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
401 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
402 ],
403 'label_block' => true,
404 'default' => 'default',
405 'description' => esc_html__( 'Please select the post title limit.', 'shopbuilder' ),
406 ];
407
408 $fields['title_limit_custom'] = [
409 'type' => 'number',
410 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
411 'default' => 200,
412 'description' => esc_html__( 'Please enter the post title character limit.', 'shopbuilder' ),
413 'condition' => [ 'title_limit' => [ 'custom' ] ],
414 ];
415
416 $fields['post_title_section_end'] = $obj->end_section();
417
418 return $fields;
419 }
420 /**
421 * Excerpt section
422 *
423 * @param object $obj Reference object.
424 *
425 * @return array
426 */
427 public static function post_excerpt( $obj ) {
428 $condition = [
429 'show_short_desc' => [ 'yes' ],
430 ];
431
432 $fields['post_excerpt_section'] = $obj->start_section(
433 esc_html__( 'Short Description', 'shopbuilder' ),
434 'settings',
435 [],
436 $condition
437 );
438
439 $fields['excerpt_limit'] = [
440 'type' => 'select2',
441 'label' => esc_html__( 'Short Description Limit', 'shopbuilder' ),
442 'description' => esc_html__( 'Please select the post short description limit.', 'shopbuilder' ),
443 'options' => [
444 'default' => esc_html__( 'Default', 'shopbuilder' ),
445 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
446 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
447 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
448 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
449 ],
450 'label_block' => true,
451 'default' => 'default',
452 ];
453
454 $fields['excerpt_limit_custom'] = [
455 'type' => 'number',
456 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
457 'default' => 200,
458 'description' => esc_html__( 'Please enter the post short description character limit.', 'shopbuilder' ),
459 'condition' => [ 'excerpt_limit' => [ 'custom' ] ],
460 ];
461
462 $fields['post_excerpt_section_end'] = $obj->end_section();
463
464 return $fields;
465 }
466 /**
467 * Pagination section
468 *
469 * @param object $obj Reference object.
470 *
471 * @return array
472 */
473 public static function links( $obj ) {
474 $fields['links_section'] = $obj->start_section(
475 esc_html__( 'Links', 'shopbuilder' ),
476 'settings'
477 );
478 $obj->start_section( 'links_section', esc_html__( 'Detail Page', 'shopbuilder' ), 'settings' );
479
480 $fields['title_link'] = [
481 'type' => 'switch',
482 'label' => esc_html__( 'Title Clickable?', 'shopbuilder' ),
483 'description' => esc_html__( 'Switch on to enable title linking.', 'shopbuilder' ),
484 'label_on' => esc_html__( 'On', 'shopbuilder' ),
485 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
486 'default' => 'yes',
487 ];
488
489 $fields['image_link'] = [
490 'type' => 'switch',
491 'label' => esc_html__( 'Image Clickable?', 'shopbuilder' ),
492 'description' => esc_html__( 'Switch on to enable image linking.', 'shopbuilder' ),
493 'label_on' => esc_html__( 'On', 'shopbuilder' ),
494 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
495 'default' => 'yes',
496 ];
497
498 $fields['links_section_end'] = $obj->end_section();
499
500 return $fields;
501 }
502 /**
503 * Pagination Style section
504 *
505 * @param object $obj Reference object.
506 *
507 * @return array
508 */
509 public static function post_pagination_style_settings( $obj ) {
510 $fields = StyleFieldsFree::pagination( $obj );
511 unset( $fields['pagination_buttons_active_color']['condition'] );
512 unset( $fields['pagination_buttons_active_bg_color']['condition'] );
513 unset( $fields['pagination_buttons_spacing']['condition'] );
514 return $fields;
515 }
516 /**
517 * Builds an array with field values.
518 *
519 * @param array $meta Field values.
520 * @param string $template Template name.
521 * @param array $raw_settings Raw settings.
522 *
523 * @return array
524 */
525 public static function post_meta_dataset( array $meta, $template = '', $raw_settings = [] ) {
526 $data = apply_filters(
527 'rtsb/elementor/render/post_meta_dataset',
528 [
529 // Layout.
530 'widget' => 'custom',
531 'template' => RenderHelpers::get_data( $template, '', '' ),
532 'raw_settings' => $raw_settings,
533 'layout' => RenderHelpers::get_data( $meta, 'layout', 'layout1' ),
534 'd_cols' => RenderHelpers::get_data( $meta, 'cols', 0 ),
535 't_cols' => RenderHelpers::get_data( $meta, 'cols_tablet', 2 ),
536 'm_cols' => RenderHelpers::get_data( $meta, 'cols_mobile', 1 ),
537
538 // Query.
539 'post_in' => RenderHelpers::get_data( $meta, 'include_posts', [] ),
540 'post_not_in' => RenderHelpers::get_data( $meta, 'exclude_posts', [] ),
541 'limit' => ( empty( $meta['posts_limit'] ) || '-1' === $meta['posts_limit'] ) ? 10000000 : $meta['posts_limit'],
542 'offset' => RenderHelpers::get_data( $meta, 'posts_offset', 0 ),
543 'order_by' => RenderHelpers::get_data( $meta, 'posts_order_by', 'date' ),
544 'order' => RenderHelpers::get_data( $meta, 'posts_order', 'DESC' ),
545 'categories' => RenderHelpers::get_data( $meta, 'filter_categories', [] ),
546 'tags' => RenderHelpers::get_data( $meta, 'filter_tags', [] ),
547 'relation' => RenderHelpers::get_data( $meta, 'tax_relation', 'OR' ),
548 // Pagination.
549 'pagination' => ! empty( $meta['show_pagination'] ),
550 'posts_per_page' => RenderHelpers::get_data( $meta, 'pagination_per_page', '' ),
551
552 ]
553 );
554 if ( ! empty( $meta['cols_widescreen'] ) ) {
555 $data['w_cols'] = $meta['cols_widescreen'];
556 }
557
558 if ( ! empty( $meta['cols_laptop'] ) ) {
559 $data['l_cols'] = $meta['cols_laptop'];
560 }
561
562 if ( ! empty( $meta['cols_tablet_extra'] ) ) {
563 $data['te_cols'] = $meta['cols_tablet_extra'];
564 }
565
566 if ( ! empty( $meta['cols_mobile_extra'] ) ) {
567 $data['me_cols'] = $meta['cols_mobile_extra'];
568 }
569 return apply_filters( 'rtsb/elementor/render/post_meta_dataset_final', $data, $meta, $raw_settings );
570 }
571 /**
572 * Gets posts arguments.
573 *
574 * @return array posts data.
575 */
576 public static function get_post_arg_dataset( $settings ) {
577 global $post;
578
579 $title_limit_custom = $settings['title_limit_custom'] ?? '';
580 $excerpt_limit_custom = $settings['excerpt_limit_custom'] ?? '200';
581
582 return [
583 'title' => Fns::text_truncation( get_the_title( $post->ID ), $title_limit_custom ),
584 'excerpt' => Fns::text_truncation( do_shortcode( get_post_field( 'post_content', $post->ID ) ), $excerpt_limit_custom ),
585 'img_html' => self::render_posts_thumbnail( $post->ID, $settings ),
586 ];
587 }
588 /**
589 * Function to generate item class.
590 *
591 * @return string
592 */
593 public static function render_posts_thumbnail( $post_id, $settings ) {
594 $c_image_size = RenderHelpers::get_data( $settings, 'img_dimension', [] );
595 $c_image_size['crop'] = RenderHelpers::get_data( $settings, 'img_dimension', [] );
596 $f_img_size = RenderHelpers::get_data( $settings, 'image_size', 'medium' );
597 $thumbnail_id = get_post_thumbnail_id( $post_id );
598 return $settings['show_post_thumbnail'] ? Fns::get_product_image_html(
599 '',
600 null,
601 $f_img_size,
602 $thumbnail_id,
603 ! empty( $c_image_size ) && is_array( $c_image_size ) ? $c_image_size : [],
604 false
605 ) : null;
606 }
607 /**
608 * Prints HTML with category list information about theme categories.
609 *
610 * @return string
611 */
612 public static function rtsb_posted_taxonomy( $type = 'category' ) {
613 $categories_list = get_the_category_list( self::rtsb_list_item_separator() );
614 if ( 'tag' === $type ) {
615 $categories_list = get_the_tag_list( '', self::rtsb_list_item_separator() );
616 }
617 if ( $categories_list ) {
618 /* translators: %s: CSS class, %s: List of category or tag links. */
619 return sprintf(
620 '<span class="%s-links">%s</span>',
621 $type,
622 $categories_list
623 );
624 }
625
626 return '';
627 }
628 /**
629 * Prints HTML with meta information for the current post-date/time.
630 *
631 * @return string
632 */
633 public static function rtsb_posted_date() {
634 $time_string = sprintf(
635 '<time class="entry-date published updated" datetime="%1$s">%2$s</time>',
636 esc_attr( get_the_date( DATE_W3C ) ),
637 esc_html( get_the_date() )
638 );
639 return sprintf( '<span class="posted-on">%s</span>', $time_string );
640 }
641 /**
642 * Prints HTML with meta information about theme author.
643 *
644 * @return string
645 */
646 public static function rtsb_posted_by( $prefix = '' ) {
647 return sprintf(
648 /* translators: %1$s: Optional prefix (e.g., "Posted by"), %2$s: Author name with a link. */
649 esc_html__( '%1$s %2$s', 'shopbuilder' ),
650 $prefix ? '<span class="prefix">' . $prefix . '</span>' : '',
651 '<span class="byline"><a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" rel="author">' . esc_html( get_the_author() ) . '</a></span>'
652 );
653 }
654 public static function rtsb_list_item_separator() {
655 $separator = sprintf(
656 /* translators: Used between list items, there is a space after the comma. */
657 "<span class='%s'>%s</span>",
658 'sp',
659 ' '
660 );
661
662 return apply_filters( 'rtsb_post_list_item_separator', $separator );
663 }
664 /**
665 * Content Box style section
666 *
667 * @param object $obj Reference object.
668 *
669 * @return array
670 */
671 public static function post_list_item_style( $obj ) {
672
673 $css_selectors = $obj->selectors['post_list_item_style'];
674 $title = esc_html__( 'Post Item', 'shopbuilder' );
675 $selectors = [
676 'box_shadow' => $css_selectors['box_shadow'],
677 'hover_box_shadow' => $css_selectors['hover_box_shadow'],
678 'border' => $css_selectors['border'],
679 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
680 'content_alignment' => [ $css_selectors['content_alignment'] => 'align-items: {{VALUE}};' ],
681 'content_hr_alignment' => [ $css_selectors['content_hr_alignment'] => 'text-align:{{VALUE}};justify-content: {{VALUE}};' ],
682 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
683 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
684 ];
685
686 $fields = ControlHelper::general_elementor_style( 'post_list_item_style', $title, $obj, [], $selectors );
687
688 unset(
689 $fields['post_list_item_style_typo_note'],
690 $fields['rtsb_el_post_list_item_style_typography'],
691 $fields['post_list_item_style_color'],
692 $fields['post_list_item_style_alignment'],
693 $fields['post_list_item_style_color_tabs'],
694 $fields['post_list_item_style_color_tab'],
695 $fields['post_list_item_style_color_tab_end'],
696 $fields['post_list_item_style_hover_color_tab'],
697 $fields['post_list_item_style_hover_color'],
698 $fields['post_list_item_style_hover_bg_color'],
699 $fields['post_list_item_style_hover_color_tab_end'],
700 $fields['post_list_item_style_color_tabs_end'],
701 $fields['post_list_item_style_border_hover_color'],
702 $fields['post_list_item_style_margin']
703 );
704 $fields['post_list_item_style_border_note']['separator'] = 'default';
705 $fields['post_list_item_style_color_note']['separator'] = 'default';
706 $extra_controls['post_list_item_style_border_radius'] = [
707 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
708 'type' => 'dimensions',
709 'mode' => 'responsive',
710 'size_units' => [ 'px' ],
711 'selectors' => $selectors['border_radius'],
712 ];
713 $fields = Fns::insert_controls( 'post_list_item_style_spacing_note', $fields, $extra_controls );
714
715 $extra_controls2['rtsb_post_list_item_style_box_shadow'] = [
716 'type' => 'box-shadow',
717 'mode' => 'group',
718 'label' => esc_html__( 'Box Shadow', 'shopbuilder' ),
719 'selector' => $selectors['box_shadow'],
720 ];
721 $extra_controls2['rtsb_post_list_item_style_hover_box_shadow'] = [
722 'type' => 'box-shadow',
723 'mode' => 'group',
724 'label' => esc_html__( 'Hover Box Shadow', 'shopbuilder' ),
725 'selector' => $selectors['hover_box_shadow'],
726 'condition' => [
727 'layout_style' => [ 'rtsb-post-grid-layout1','rtsb-post-grid-layout2','rtsb-post-grid-layout3' ],
728 ],
729 ];
730 $fields = Fns::insert_controls( 'post_list_item_style_border_note', $fields, $extra_controls2 );
731 $extra_controls3['content_align_note'] = $obj->el_heading( esc_html__( 'Alignment', 'shopbuilder' ), 'default' );
732 $extra_controls3['content_align_note']['condition'] = [
733 'layout_style!' => [ 'rtsb-post-grid-layout1','rtsb-post-grid-layout2','rtsb-post-grid-layout3' ],
734 ];
735 $extra_controls3['content_alignment_style'] = [
736 'mode' => 'responsive',
737 'type' => 'choose',
738 'label' => esc_html__( 'Vertical Content', 'shopbuilder' ),
739 'options' => [
740 'start' => [
741 'title' => esc_html__( 'Start', 'shopbuilder' ),
742 'icon' => 'eicon-justify-start-v',
743 ],
744 'center' => [
745 'title' => esc_html__( 'Center', 'shopbuilder' ),
746 'icon' => 'eicon-justify-center-v',
747 ],
748 'end' => [
749 'title' => esc_html__( 'End', 'shopbuilder' ),
750 'icon' => 'eicon-justify-end-v',
751 ],
752
753 ],
754 'toggle' => true,
755 'selectors' => $selectors['content_alignment'] ,
756 'default' => 'start',
757 'condition' => [
758 'layout_style!' => [ 'rtsb-post-grid-layout1','rtsb-post-grid-layout2','rtsb-post-grid-layout3' ],
759 ],
760 ];
761 $extra_controls3['content_hr_alignment_style'] = [
762 'mode' => 'responsive',
763 'type' => 'choose',
764 'label' => esc_html__( 'Horizontal Content', 'shopbuilder' ),
765 'options' => [
766 'start' => [
767 'title' => esc_html__( 'Start', 'shopbuilder' ),
768 'icon' => 'eicon-justify-start-h',
769 ],
770 'center' => [
771 'title' => esc_html__( 'Center', 'shopbuilder' ),
772 'icon' => 'eicon-justify-center-h',
773 ],
774 'end' => [
775 'title' => esc_html__( 'End', 'shopbuilder' ),
776 'icon' => 'eicon-justify-end-h',
777 ],
778
779 ],
780 'toggle' => true,
781 'selectors' => $selectors['content_hr_alignment'] ,
782 'default' => 'start',
783 // 'condition' => [
784 // 'layout_style!' => [ 'rtsb-post-grid-layout1','rtsb-post-grid-layout2','rtsb-post-grid-layout3' ],
785 // ],
786 ];
787 $fields = Fns::insert_controls( 'post_list_item_style_color_note', $fields, $extra_controls3 );
788 return $fields;
789 }
790 /**
791 * Title style section
792 *
793 * @param object $obj Reference object.
794 *
795 * @return array
796 */
797 public static function title_style( $obj ) {
798 $condition = [
799 'show_title' => 'yes',
800 ];
801 $css_selectors = $obj->selectors['title_style'];
802 $title = esc_html__( 'Title', 'shopbuilder' );
803 $selectors = [
804 'typography' => $css_selectors['typography'],
805 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
806 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
807 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
808 ];
809
810 $fields = ControlHelper::general_elementor_style( 'title_style', $title, $obj, $condition, $selectors );
811 unset(
812 $fields['title_style_alignment'],
813 $fields['rtsb_el_title_style_border'],
814 $fields['title_style_border_note'],
815 $fields['title_style_bg_color'],
816 $fields['title_style_hover_bg_color'],
817 $fields['title_style_border_hover_color'],
818 $fields['title_style_padding'],
819 );
820 return $fields;
821 }
822 /**
823 * Content style section
824 *
825 * @param object $obj Reference object.
826 *
827 * @return array
828 */
829 public static function content_style( $obj ) {
830 $condition = [
831 'show_short_desc' => 'yes',
832 ];
833 $css_selectors = $obj->selectors['content_style'];
834 $title = esc_html__( 'Content', 'shopbuilder' );
835 $selectors = [
836 'typography' => $css_selectors['typography'],
837 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
838 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
839 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
840 ];
841
842 $fields = ControlHelper::general_elementor_style( 'content_style', $title, $obj, $condition, $selectors );
843 $fields['content_style_padding']['label'] = esc_html__( 'Wrapper Padding', 'shopbuilder' );
844 unset(
845 $fields['content_style_alignment'],
846 $fields['rtsb_el_content_style_border'],
847 $fields['content_style_border_note'],
848 $fields['content_style_color_tabs'],
849 $fields['content_style_color_tab'],
850 $fields['content_style_color_tab_end'],
851 $fields['content_style_hover_color_tab'],
852 $fields['content_style_bg_color'],
853 $fields['content_style_hover_color'],
854 $fields['content_style_hover_bg_color'],
855 $fields['content_style_border_hover_color'],
856 $fields['content_style_hover_color_tab_end'],
857 $fields['content_style_color_tabs_end'],
858 );
859 return $fields;
860 }
861
862 /**
863 * Image style section
864 *
865 * @param object $obj Reference object.
866 *
867 * @return array
868 */
869 public static function image_styles( $obj ) {
870 $condition = [
871 'show_post_thumbnail' => 'yes',
872 ];
873 $alignment_options = ControlHelper::alignment();
874 unset( $alignment_options['justify'] );
875 $fields['image_style_sec_start'] = $obj->start_section(
876 esc_html__( 'Image', 'shopbuilder' ),
877 'style',
878 [],
879 $condition
880 );
881 $fields['image_styles_dimension_note'] = $obj->el_heading( esc_html__( 'Dimension', 'shopbuilder' ) );
882 $fields['image_styles_width'] = [
883 'type' => 'slider',
884 'mode' => 'responsive',
885 'label' => esc_html__( 'Image Width', 'shopbuilder' ),
886 'size_units' => [ '%', 'px' ],
887 'range' => [
888 '%' => [
889 'min' => 0,
890 'max' => 100,
891 'step' => 1,
892 ],
893 'px' => [
894 'min' => 0,
895 'max' => 600,
896 'step' => 1,
897 ],
898 ],
899 'selectors' => [
900 $obj->selectors['image_style']['width'] => 'width: {{SIZE}}{{UNIT}};flex: 0 0 {{SIZE}}{{UNIT}};',
901 ],
902 ];
903 $fields['image_styles_max_width'] = [
904 'type' => 'slider',
905 'mode' => 'responsive',
906 'label' => esc_html__( 'Image Max-Width', 'shopbuilder' ),
907 'size_units' => [ '%', 'px' ],
908 'range' => [
909 '%' => [
910 'min' => 0,
911 'max' => 100,
912 'step' => 1,
913 ],
914 'px' => [
915 'min' => 0,
916 'max' => 600,
917 'step' => 1,
918 ],
919
920 ],
921 'selectors' => [
922 $obj->selectors['image_style']['max_width'] => 'max-width: {{SIZE}}{{UNIT}};',
923 ],
924 ];
925 $fields['image_border_note'] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' );
926 $fields['image_border'] = [
927 'mode' => 'group',
928 'type' => 'border',
929 'label' => esc_html__( 'Border', 'shopbuilder' ),
930 'selector' => $obj->selectors['image_style']['border'],
931 'fields_options' => [
932 'color' => [
933 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
934 ],
935 ],
936 'separator' => 'default',
937 ];
938 $fields['image_styles_radius'] = [
939 'mode' => 'responsive',
940 'type' => 'dimensions',
941 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
942 'size_units' => [ 'px', '%', 'em' ],
943 'selectors' => [
944 $obj->selectors['image_style']['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
945 ],
946 ];
947 $fields['image_styles_spacing_note'] = $obj->el_heading( esc_html__( 'Spacing', 'shopbuilder' ) );
948 $fields['image_styles_margin'] = [
949 'mode' => 'responsive',
950 'type' => 'dimensions',
951 'label' => esc_html__( 'Margin', 'shopbuilder' ),
952 'size_units' => [ 'px', '%', 'em' ],
953 'selectors' => [
954 $obj->selectors['image_style']['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
955 ],
956 ];
957 $fields['image_sec_end'] = $obj->end_section();
958
959 return $fields;
960 }
961 /**
962 * Button style section
963 *
964 * @param object $obj Reference object.
965 *
966 * @return array
967 */
968 public static function button_style( $obj, $type = 'primary' ) {
969 $condition = [
970 'show_read_more_btn' => 'yes',
971 ];
972 $css_selectors = $obj->selectors['readmore_button_style'];
973 $title = esc_html__( 'Read More Button', 'shopbuilder' );
974 $selectors = [
975 'typography' => $css_selectors['typography'],
976 'icon_size' => [
977 $css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}};',
978 $css_selectors['icon_size']['svg'] => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};',
979 ],
980 'icon_gap' => [ $css_selectors['icon_gap'] => 'gap: {{SIZE}}{{UNIT}};' ],
981 'btn_width' => [ $css_selectors['btn_width'] => 'min-width: {{SIZE}}{{UNIT}};' ],
982 'btn_height' => [ $css_selectors['btn_height'] => 'height: {{SIZE}}{{UNIT}};' ],
983 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
984 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
985 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
986 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
987 'border' => $css_selectors['border'],
988 'box_shadow' => $css_selectors['box_shadow'],
989 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
990 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
991 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
992 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
993 ];
994
995 $fields = ControlHelper::general_elementor_style( 'readmore_button_style', $title, $obj, $condition, $selectors );
996 unset(
997 $fields['readmore_button_style_alignment'],
998 );
999 $extra_controls['readmore_button_style_border_radius'] = [
1000 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1001 'type' => 'dimensions',
1002 'mode' => 'responsive',
1003 'size_units' => [ 'px' ],
1004 'selectors' => $selectors['border_radius'],
1005 ];
1006 $fields = Fns::insert_controls( 'readmore_button_style_spacing_note', $fields, $extra_controls );
1007 $extra_controls2['readmore_button_style_btn_width'] = [
1008 'type' => 'slider',
1009 'mode' => 'responsive',
1010 'label' => esc_html__( 'Button Width', 'shopbuilder' ),
1011 'size_units' => [ 'px','%' ],
1012 'range' => [
1013 'px' => [
1014 'min' => 10,
1015 'max' => 1000,
1016 ],
1017 '%' => [
1018 'min' => 0,
1019 'max' => 100,
1020 ],
1021 ],
1022 'selectors' => $selectors['btn_width'],
1023 ];
1024 $extra_controls2['readmore_button_style_btn_height'] = [
1025 'type' => 'slider',
1026 'mode' => 'responsive',
1027 'label' => esc_html__( 'Button Height', 'shopbuilder' ),
1028 'size_units' => [ 'px','%' ],
1029 'range' => [
1030 'px' => [
1031 'min' => 10,
1032 'max' => 1000,
1033 ],
1034 '%' => [
1035 'min' => 0,
1036 'max' => 100,
1037 ],
1038 ],
1039 'selectors' => $selectors['btn_height'],
1040 ];
1041
1042 $extra_controls2['readmore_button_style_icon_size'] = [
1043 'type' => 'slider',
1044 'mode' => 'responsive',
1045 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1046 'size_units' => [ 'px' ],
1047 'range' => [
1048 'px' => [
1049 'min' => 0,
1050 'max' => 100,
1051 ],
1052 ],
1053 'selectors' => $selectors['icon_size'],
1054 ];
1055 $extra_controls2['readmore_button_style_icon_gap'] = [
1056 'type' => 'slider',
1057 'mode' => 'responsive',
1058 'label' => esc_html__( 'Icon Gap', 'shopbuilder' ),
1059 'size_units' => [ 'px' ],
1060 'range' => [
1061 'px' => [
1062 'min' => 0,
1063 'max' => 100,
1064 ],
1065 ],
1066 'selectors' => $selectors['icon_gap'],
1067 ];
1068 $extra_controls2['readmore_button_style_box_shadow'] = [
1069 'type' => 'box-shadow',
1070 'mode' => 'group',
1071 'label' => esc_html__( 'Box Shadow', 'shopbuilder' ),
1072 'selector' => $selectors['box_shadow'],
1073 ];
1074 $fields = Fns::insert_controls( 'readmore_button_style_spacing_note', $fields, $extra_controls2, true );
1075
1076 return $fields;
1077 }
1078 /**
1079 * Meta style section
1080 *
1081 * @param object $obj Reference object.
1082 *
1083 * @return array
1084 */
1085 public static function meta_style( $obj ) {
1086 $conditions = [
1087 'relation' => 'or',
1088 'terms' => [
1089 [
1090 'name' => 'show_dates',
1091 'operator' => '==',
1092 'value' => 'yes',
1093 ],
1094 [
1095 'name' => 'show_author',
1096 'operator' => '==',
1097 'value' => 'yes',
1098 ],
1099 ],
1100 ];
1101 $css_selectors = $obj->selectors['post_meta_style'];
1102 $title = esc_html__( 'Meta', 'shopbuilder' );
1103 $selectors = [
1104 'typography' => $css_selectors['typography'],
1105 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
1106 'meta_link_color' => [ $css_selectors['meta_link_color'] => 'color: {{VALUE}};' ],
1107 'meta_icon_color' => [ $css_selectors['meta_icon_color'] => 'fill: {{VALUE}};' ],
1108 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
1109 'meta_gap' => [ $css_selectors['meta_gap'] => 'gap: {{SIZE}}{{UNIT}};' ],
1110 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
1111 ];
1112
1113 $fields = ControlHelper::general_elementor_style( 'post_meta_style', $title, $obj, [], $selectors, $conditions );
1114 $fields['post_meta_style_hover_color']['label'] = esc_html__( 'Link Hover Color', 'shopbuilder' );
1115 unset(
1116 $fields['post_meta_style_alignment'],
1117 $fields['rtsb_el_post_meta_style_border'],
1118 $fields['post_meta_style_border_note'],
1119 $fields['post_meta_style_bg_color'],
1120 $fields['post_meta_style_hover_bg_color'],
1121 $fields['post_meta_style_border_hover_color'],
1122 $fields['post_meta_style_padding'],
1123 );
1124 $extra_controls['post_meta_link_color'] = [
1125 'type' => 'color',
1126 'label' => esc_html__( 'Link Color', 'shopbuilder' ),
1127 'selectors' => $selectors['meta_link_color'],
1128 ];
1129 $extra_controls['post_meta_icon_color'] = [
1130 'type' => 'color',
1131 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
1132 'selectors' => $selectors['meta_icon_color'],
1133 ];
1134 $fields = Fns::insert_controls( 'post_meta_style_color', $fields, $extra_controls, true );
1135 $extra_controls2['post_meta_gap'] = [
1136 'type' => 'slider',
1137 'mode' => 'responsive',
1138 'label' => esc_html__( 'Meta Gap', 'shopbuilder' ),
1139 'size_units' => [ 'px' ],
1140 'range' => [
1141 'px' => [
1142 'min' => 0,
1143 'max' => 100,
1144 ],
1145 ],
1146 'selectors' => $selectors['meta_gap'],
1147 ];
1148 $fields = Fns::insert_controls( 'post_meta_style_spacing_note', $fields, $extra_controls2, true );
1149 return $fields;
1150 }
1151 /**
1152 * Taxonomy style section
1153 *
1154 * @param object $obj Reference object.
1155 *
1156 * @return array
1157 */
1158 public static function taxonomy_style( $obj ) {
1159 $conditions = [
1160 'relation' => 'or',
1161 'terms' => [
1162 [
1163 'name' => 'show_categories',
1164 'operator' => '==',
1165 'value' => 'yes',
1166 ],
1167 [
1168 'name' => 'show_tags',
1169 'operator' => '==',
1170 'value' => 'yes',
1171 ],
1172 ],
1173 ];
1174 $css_selectors = $obj->selectors['post_taxonomy_style'];
1175 $title = esc_html__( 'Category/Tag', 'shopbuilder' );
1176 $selectors = [
1177 'typography' => $css_selectors['typography'],
1178 'border' => $css_selectors['border'],
1179 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
1180 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
1181 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
1182 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
1183 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
1184 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1185 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
1186 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1187 'taxonomy_gap' => [ $css_selectors['taxonomy_gap'] => 'gap: {{SIZE}}{{UNIT}};' ],
1188
1189 ];
1190
1191 $fields = ControlHelper::general_elementor_style( 'post_taxonomy_style', $title, $obj, [], $selectors, $conditions );
1192
1193 unset(
1194 $fields['post_taxonomy_style_alignment'],
1195 );
1196 $extra_controls['taxonomy_border_radius'] = [
1197 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1198 'type' => 'dimensions',
1199 'mode' => 'responsive',
1200 'size_units' => [ 'px' ],
1201 'selectors' => $selectors['border_radius'],
1202 ];
1203 $fields = Fns::insert_controls( 'post_taxonomy_style', $fields, $extra_controls );
1204 $extra_controls2['post_taxonomy_gap'] = [
1205 'type' => 'slider',
1206 'mode' => 'responsive',
1207 'label' => esc_html__( 'Meta Gap', 'shopbuilder' ),
1208 'size_units' => [ 'px' ],
1209 'range' => [
1210 'px' => [
1211 'min' => 0,
1212 'max' => 100,
1213 ],
1214 ],
1215 'selectors' => $selectors['taxonomy_gap'],
1216 ];
1217 $fields = Fns::insert_controls( 'post_taxonomy_style_spacing_note', $fields, $extra_controls2, true );
1218 return $fields;
1219 }
1220 public static function rtsb_post_image_hover_effect() {
1221 return apply_filters(
1222 'rtsb/general/widget/post_widget_image_hover_effect',
1223 [
1224 'rtsb-gw-img-effect-none' => __( 'None', 'shopbuilder' ),
1225 'rtsb-gw-img-zoom-in' => __( 'Scale In', 'shopbuilder' ),
1226 'rtsb-gw-img-zoom-out' => __( 'Scale Out', 'shopbuilder' ),
1227 'rtsb-gw-img-slide-up' => __( 'Slide Up', 'shopbuilder' ),
1228 'rtsb-gw-img-slide-down' => __( 'Slide Down', 'shopbuilder' ),
1229 'rtsb-gw-img-slide-right' => __( 'Slide Right', 'shopbuilder' ),
1230 'rtsb-gw-img-slide-left' => __( 'Slide Left', 'shopbuilder' ),
1231 ]
1232 );
1233 }
1234
1235 public static function post_pagination_selectors() {
1236 return [
1237 'typography' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li span, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button',
1238 'alignment' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap',
1239 'width' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li span, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button',
1240 'height' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li span, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button',
1241 'color' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button',
1242 'bg_color' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button',
1243 'active_color' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li span',
1244 'active_bg_color' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li span',
1245 'hover_color' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a:hover, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button:hover, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button:hover',
1246 'hover_bg_color' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a:hover, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button:hover, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button:hover',
1247 'border' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li span, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button',
1248 'border_hover_color' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a:hover, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button:hover, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button:hover',
1249 'border_active_color' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li span',
1250 'border_radius' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li a, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list li span, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button',
1251 'spacing' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap',
1252 'padding' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap .rtsb-load-more button, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap .rtsb-load-more button',
1253 'margin' => '{{WRAPPER}} .rtsb-elementor-container .rtsb-pagination ul.pagination-list, {{WRAPPER}} .rtsb-elementor-container .rtsb-pagination-wrap, {{WRAPPER}} .rtsb-elementor-container .rtsb-archive-pagination-wrap',
1254 ];
1255 }
1256 }
1257