PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.17
UiCore Elements – Free widgets and templates for Elementor v1.3.17
1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 All 41 releases
← All changes | includes/utils/testimonial-component.php +853 -835 1.0.71.3.17 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 namespace UiCoreElements\Utils;
3 4
4 5 use Elementor\Controls_Manager;
5 6 use Elementor\Plugin;
@@ -16,9 +17,10 @@
16 17
17 18
18 19 defined('ABSPATH') || exit();
19 20
20 -trait Testimonial_Trait {
21 +trait Testimonial_Trait
22 +{
21 23
22 24 // Content Controls Functions
23 25 function TRAIT_register_testimonial_repeater_controls($logo)
24 26 {
@@ -24,137 +26,138 @@
24 26 {
25 27 $this->start_controls_section(
26 28 'section_reviewer_content',
27 29 [
28 - 'label' => __($logo, 'uicore-elements'),
30 + /* translators: %s: Control title */
31 + 'label' => esc_html(sprintf('%s', $logo), 'uicore-elements'),
29 32 'tab' => Controls_Manager::TAB_CONTENT,
30 33 ]
31 34 );
32 35
33 - $repeater = new Repeater();
36 + $repeater = new Repeater();
34 37
35 - $repeater->add_control(
36 - 'avatar',
37 - [
38 - 'label' => __('Avatar', 'uicore-elements'),
39 - 'type' => Controls_Manager::MEDIA,
40 - 'render_type' => 'template',
41 - 'dynamic' => [
42 - 'active' => true,
38 + $repeater->add_control(
39 + 'avatar',
40 + [
41 + 'label' => __('Avatar', 'uicore-elements'),
42 + 'type' => Controls_Manager::MEDIA,
43 + 'render_type' => 'template',
44 + 'dynamic' => [
45 + 'active' => true,
46 + ],
47 + 'default' => [
48 + 'url' => Utils::get_placeholder_image_src(),
49 + ],
50 + ]
51 + );
52 + $repeater->add_control(
53 + 'reviewer_name',
54 + [
55 + 'label' => __('Name', 'uicore-elements'),
56 + 'type' => Controls_Manager::TEXT,
57 + 'dynamic' => [
58 + 'active' => true,
59 + ],
60 + 'default' => __('Adam Smith', 'uicore-elements'),
61 + 'placeholder' => __('Enter reviewer name', 'uicore-elements'),
62 + 'label_block' => true,
63 + ]
64 + );
65 + $repeater->add_control(
66 + 'reviewer_job_title',
67 + [
68 + 'label' => __('Job Title', 'uicore-elements'),
69 + 'type' => Controls_Manager::TEXT,
70 + 'dynamic' => [
71 + 'active' => true,
72 + ],
73 + 'default' => __('SEO Expert', 'uicore-elements'),
74 + 'placeholder' => __('Enter reviewer job title', 'uicore-elements'),
75 + 'label_block' => true,
76 + ]
77 + );
78 + $repeater->add_control(
79 + 'rating_number',
80 + [
81 + 'label' => __('Rating', 'uicore-elements'),
82 + 'type' => Controls_Manager::SLIDER,
83 + 'size_units' => ['px'],
84 + 'default' => [
85 + 'size' => 4.5,
86 + ],
87 + 'range' => [
88 + 'px' => [
89 + 'min' => 0,
90 + 'max' => 5,
91 + 'step' => .5,
43 92 ],
44 - 'default' => [
45 - 'url' => Utils::get_placeholder_image_src(),
93 + ],
94 + 'dynamic' => [
95 + 'active' => true,
96 + ],
97 + ]
98 + );
99 + $repeater->add_control(
100 + 'review_text',
101 + [
102 + 'label' => __('Review Text', 'uicore-elements'),
103 + 'type' => Controls_Manager::WYSIWYG,
104 + 'dynamic' => [
105 + 'active' => true,
106 + ],
107 + 'default' => __('Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'uicore-elements'),
108 + 'placeholder' => __('Enter review text', 'uicore-elements'),
109 + ]
110 + );
111 + $repeater->add_control(
112 + 'image',
113 + [
114 + 'label' => __('Secondary Image', 'uicore-elements'),
115 + 'type' => Controls_Manager::MEDIA,
116 + 'render_type' => 'template',
117 + 'dynamic' => [
118 + 'active' => true,
119 + ],
120 + 'default' => [
121 + 'url' => Utils::get_placeholder_image_src(),
122 + ],
123 + ]
124 + );
125 + $this->add_control(
126 + 'review_items',
127 + [
128 + 'show_label' => false,
129 + 'type' => Controls_Manager::REPEATER,
130 + 'fields' => $repeater->get_controls(),
131 + 'title_field' => '{{{ reviewer_name }}}',
132 + 'default' => [
133 + [
134 + 'reviewer_name' => __('Adam', 'uicore-elements'),
135 + 'reviewer_job_title' => __('SEO Expert', 'uicore-elements'),
46 136 ],
47 - ]
48 - );
49 - $repeater->add_control(
50 - 'reviewer_name',
51 - [
52 - 'label' => __('Name', 'uicore-elements'),
53 - 'type' => Controls_Manager::TEXT,
54 - 'dynamic' => [
55 - 'active' => true,
137 + [
138 + 'reviewer_name' => __('Karl', 'uicore-elements'),
139 + 'reviewer_job_title' => __('Designer', 'uicore-elements'),
56 140 ],
57 - 'default' => __('Adam Smith', 'uicore-elements'),
58 - 'placeholder' => __('Enter reviewer name', 'uicore-elements'),
59 - 'label_block' => true,
60 - ]
61 - );
62 - $repeater->add_control(
63 - 'reviewer_job_title',
64 - [
65 - 'label' => __('Job Title', 'uicore-elements'),
66 - 'type' => Controls_Manager::TEXT,
67 - 'dynamic' => [
68 - 'active' => true,
141 + [
142 + 'reviewer_name' => __('Maria', 'uicore-elements'),
143 + 'reviewer_job_title' => __('Developer', 'uicore-elements'),
69 144 ],
70 - 'default' => __('SEO Expert', 'uicore-elements'),
71 - 'placeholder' => __('Enter reviewer job title', 'uicore-elements'),
72 - 'label_block' => true,
73 - ]
74 - );
75 - $repeater->add_control(
76 - 'rating_number',
77 - [
78 - 'label' => __( 'Rating', 'uicore-elements' ),
79 - 'type' => Controls_Manager::SLIDER,
80 - 'size_units' => [ 'px' ],
81 - 'default' => [
82 - 'size' => 4.5,
145 + [
146 + 'reviewer_name' => __('Michael', 'uicore-elements'),
147 + 'reviewer_job_title' => __('Manager', 'uicore-elements'),
83 148 ],
84 - 'range' => [
85 - 'px' => [
86 - 'min' => 0,
87 - 'max' => 5,
88 - 'step' => .5,
89 - ],
149 + [
150 + 'reviewer_name' => __('Lena', 'uicore-elements'),
151 + 'reviewer_job_title' => __('CEO', 'uicore-elements'),
90 152 ],
91 - 'dynamic' => [
92 - 'active' => true,
153 + [
154 + 'reviewer_name' => __('Jennifer', 'uicore-elements'),
155 + 'reviewer_job_title' => __('Consultant', 'uicore-elements'),
93 156 ],
94 157 ]
95 - );
96 - $repeater->add_control(
97 - 'review_text',
98 - [
99 - 'label' => __('Review Text', 'uicore-elements'),
100 - 'type' => Controls_Manager::WYSIWYG,
101 - 'dynamic' => [
102 - 'active' => true,
103 - ],
104 - 'default' => __('Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'uicore-elements'),
105 - 'placeholder' => __('Enter review text', 'uicore-elements'),
106 - ]
107 - );
108 - $repeater->add_control(
109 - 'image',
110 - [
111 - 'label' => __('Secondary Image', 'uicore-elements'),
112 - 'type' => Controls_Manager::MEDIA,
113 - 'render_type' => 'template',
114 - 'dynamic' => [
115 - 'active' => true,
116 - ],
117 - 'default' => [
118 - 'url' => Utils::get_placeholder_image_src(),
119 - ],
120 - ]
121 - );
122 - $this->add_control(
123 - 'review_items',
124 - [
125 - 'show_label' => false,
126 - 'type' => Controls_Manager::REPEATER,
127 - 'fields' => $repeater->get_controls(),
128 - 'title_field' => '{{{ reviewer_name }}}',
129 - 'default' => [
130 - [
131 - 'reviewer_name' => __( 'Adam', 'uicore-elements' ),
132 - 'reviewer_job_title' => __( 'SEO Expert', 'uicore-elements' ),
133 - ],
134 - [
135 - 'reviewer_name' => __( 'Karl', 'uicore-elements' ),
136 - 'reviewer_job_title' => __( 'Designer', 'uicore-elements' ),
137 - ],
138 - [
139 - 'reviewer_name' => __( 'Maria', 'uicore-elements' ),
140 - 'reviewer_job_title' => __( 'Developer', 'uicore-elements' ),
141 - ],
142 - [
143 - 'reviewer_name' => __( 'Michael', 'uicore-elements' ),
144 - 'reviewer_job_title' => __( 'Manager', 'uicore-elements' ),
145 - ],
146 - [
147 - 'reviewer_name' => __( 'Lena', 'uicore-elements' ),
148 - 'reviewer_job_title' => __( 'CEO', 'uicore-elements' ),
149 - ],
150 - [
151 - 'reviewer_name' => __( 'Jennifer', 'uicore-elements' ),
152 - 'reviewer_job_title' => __( 'Consultant', 'uicore-elements' ),
153 - ],
154 - ]
155 - ]
156 - );
158 + ]
159 + );
157 160
158 161 $this->end_controls_section();
159 162 }
160 163 function TRAIT_register_testimonial_additional_controls()
@@ -200,14 +203,14 @@
200 203 );
201 204 $this->add_control(
202 205 'rating_type',
203 206 [
204 - 'label' => __( 'Rating Type', 'uicore-elements' ),
207 + 'label' => __('Rating Type', 'uicore-elements'),
205 208 'type' => Controls_Manager::SELECT,
206 209 'default' => 'star',
207 210 'options' => [
208 - 'star' => __( 'Star', 'uicore-elements' ),
209 - 'number' => __( 'Number', 'uicore-elements' ),
211 + 'star' => __('Star', 'uicore-elements'),
212 + 'number' => __('Number', 'uicore-elements'),
210 213 ],
211 214 'condition' => [
212 215 'show_reviewer_rating' => 'yes'
213 216 ]
@@ -284,17 +287,17 @@
284 287 'default' => 'flex-start',
285 288 'toggle' => false,
286 289 'options' => [
287 290 'flex-start' => [
288 - 'title' => __( 'Top', 'uicore-elements' ),
291 + 'title' => __('Top', 'uicore-elements'),
289 292 'icon' => 'eicon-v-align-top',
290 293 ],
291 294 'center' => [
292 - 'title' => __( 'Center', 'uicore-elements' ),
295 + 'title' => __('Center', 'uicore-elements'),
293 296 'icon' => 'eicon-v-align-middle',
294 297 ],
295 298 'flex-end' => [
296 - 'title' => __( 'Bottom', 'uicore-elements' ),
299 + 'title' => __('Bottom', 'uicore-elements'),
297 300 'icon' => 'eicon-v-align-bottom',
298 301 ],
299 302 ],
300 303 'selectors' => [
@@ -339,8 +342,9 @@
339 342 'title' => __('Justified', 'uicore-elements'),
340 343 'icon' => 'eicon-text-align-justify',
341 344 ],
342 345 ],
346 + 'default' => is_rtl() ? 'right' : 'left',
343 347 'prefix_class' => 'ui-e-h-align-',
344 348 'selectors' => [
345 349 '{{WRAPPER}} .ui-e-item' => 'text-align: {{VALUE}};',
346 350 ],
@@ -354,9 +358,9 @@
354 358 'type' => Controls_Manager::CHOOSE,
355 359 'default' => 'center',
356 360 'options' => [
357 361 'start' => [
358 - 'title' => __('Left', 'uicore-elements'),
362 + 'title' => __('Top', 'uicore-elements'),
359 363 'icon' => 'eicon-align-start-v',
360 364 ],
361 365 'center' => [
362 366 'title' => __('Center', 'uicore-elements'),
@@ -361,13 +365,18 @@
361 365 'center' => [
362 366 'title' => __('Center', 'uicore-elements'),
363 367 'icon' => 'eicon-align-center-v',
364 368 ],
369 + 'space-between' => [
370 + 'title' => __('Space Between', 'uicore-elements'),
371 + 'icon' => 'eicon-justify-space-between-v',
372 + ],
365 373 'end' => [
366 - 'title' => __('Right', 'uicore-elements'),
374 + 'title' => __('Bottom', 'uicore-elements'),
367 375 'icon' => 'eicon-align-end-v',
368 376 ],
369 377 ],
378 + 'prefix_class' => 'ui-e-v-align-',
370 379 'selectors' => [
371 380 '{{WRAPPER}} .ui-e-item' => '--ui-e-content-v-alignment: {{VALUE}};',
372 381 ]
373 382 ]
@@ -387,175 +396,182 @@
387 396 ]
388 397 ]
389 398 );
390 399
391 - $this->add_group_control(
392 - Group_Control_Border::get_type(),
393 - [
394 - 'name' => 'avatar_border',
395 - 'selector' => '{{WRAPPER}} .ui-e-testimonial-avatar img'
396 - ]
397 - );
398 - $this->add_control(
399 - 'avatar_radius',
400 - [
401 - 'label' => esc_html__('Border Radius', 'uicore-elements'),
402 - 'type' => Controls_Manager::DIMENSIONS,
403 - 'size_units' => ['px', 'em', '%'],
404 - 'selectors' => [
405 - '{{WRAPPER}} .ui-e-testimonial-avatar img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
400 + $this->add_group_control(
401 + Group_Control_Border::get_type(),
402 + [
403 + 'name' => 'avatar_border',
404 + 'selector' => '{{WRAPPER}} .ui-e-testimonial-avatar img'
405 + ]
406 + );
407 + $this->add_control(
408 + 'avatar_radius',
409 + [
410 + 'label' => esc_html__('Border Radius', 'uicore-elements'),
411 + 'type' => Controls_Manager::DIMENSIONS,
412 + 'size_units' => ['px', 'em', '%'],
413 + 'selectors' => [
414 + '{{WRAPPER}} .ui-e-testimonial-avatar img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
415 + ],
416 + ]
417 + );
418 + $this->add_responsive_control(
419 + 'avatar_padding',
420 + [
421 + 'label' => __('Padding', 'uicore-elements'),
422 + 'type' => Controls_Manager::DIMENSIONS,
423 + 'size_units' => ['px', 'em', '%'],
424 + 'selectors' => [
425 + '{{WRAPPER}} .ui-e-testimonial-avatar img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
426 + ],
427 + ]
428 + );
429 + $this->add_responsive_control(
430 + 'avatar_size',
431 + [
432 + 'label' => __('Size', 'uicore-elements'),
433 + 'type' => Controls_Manager::SLIDER,
434 + 'size_units' => ['px', '%'],
435 + 'default' => [
436 + 'size' => 120,
437 + 'unit' => 'px'
438 + ],
439 + 'range' => [
440 + '%' => [
441 + 'min' => 1,
442 + 'max' => 100,
406 443 ],
407 - ]
408 - );
409 - $this->add_control(
410 - 'avatar_padding',
411 - [
412 - 'label' => __('Padding', 'uicore-elements'),
413 - 'type' => Controls_Manager::DIMENSIONS,
414 - 'size_units' => ['px', 'em', '%'],
415 - 'selectors' => [
416 - '{{WRAPPER}} .ui-e-testimonial-avatar img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
417 - ],
418 - ]
419 - );
420 - $this->add_responsive_control(
421 - 'avatar_size',
422 - [
423 - 'label' => __('Size', 'uicore-elements'),
424 - 'type' => Controls_Manager::SLIDER,
425 - 'default' => [
426 - 'size' => 40,
427 - 'unit' => '%'
428 - ],
429 - 'range' => [
430 - '%' => [
431 - 'min' => 1,
432 - 'max' => 100,
433 - ],
434 - ],
435 - 'selectors' => [
436 - '{{WRAPPER}}' => '--ui-e-avatar-size: {{SIZE}}%;',
437 - ],
438 - 'condition' => [
439 - 'layout!' => 'layout_5',
444 + 'px' => [
445 + 'min' => 10,
446 + 'max' => 500,
440 447 ]
448 + ],
449 + 'description' => __('Using `%` might make image height fits the available space, depending on layout and inline options, cutting the image. Using `px` althougt adjust the image.', 'uicore-elements'),
450 + 'selectors' => [
451 + '{{WRAPPER}}' => '--ui-e-avatar-size: {{SIZE}}{{UNIT}};',
452 + ],
453 + 'render_type' => 'template',
454 + 'condition' => [
455 + 'layout!' => 'layout_5',
441 456 ]
442 - );
443 - $this->add_control(
444 - 'avatar_size_px',
445 - [
446 - 'label' => __('Size', 'uicore-elements'),
447 - 'type' => Controls_Manager::SLIDER,
448 - 'default' => [
449 - 'size' => 80,
450 - 'unit' => 'px'
457 + ]
458 + );
459 + $this->add_responsive_control(
460 + 'avatar_size_px',
461 + [
462 + 'label' => __('Size', 'uicore-elements'),
463 + 'type' => Controls_Manager::SLIDER,
464 + 'default' => [
465 + 'size' => 80,
466 + 'unit' => 'px'
467 + ],
468 + 'range' => [
469 + 'px' => [
470 + 'min' => 1,
471 + 'max' => 250,
451 472 ],
452 - 'range' => [
453 - 'px' => [
454 - 'min' => 1,
455 - 'max' => 250,
456 - ],
457 - ],
458 - 'selectors' => [
459 - '{{WRAPPER}}' => '--ui-e-avatar-size: {{SIZE}}{{UNIT}};',
460 - ],
461 - 'condition' => [
462 - 'layout' => 'layout_5',
463 - ]
473 + ],
474 + 'selectors' => [
475 + '{{WRAPPER}}' => '--ui-e-avatar-size: {{SIZE}}{{UNIT}};',
476 + ],
477 + 'condition' => [
478 + 'layout' => 'layout_5',
464 479 ]
465 - );
466 - $this->add_control(
467 - 'avatar_spacing',
468 - [
469 - 'label' => __('Spacing', 'uicore-elements'),
470 - 'type' => Controls_Manager::SLIDER,
471 - 'default' => [
472 - 'size' => 15,
480 + ]
481 + );
482 + $this->add_responsive_control(
483 + 'avatar_spacing',
484 + [
485 + 'label' => __('Spacing', 'uicore-elements'),
486 + 'type' => Controls_Manager::SLIDER,
487 + 'default' => [
488 + 'size' => 15,
489 + ],
490 + 'selectors' => [
491 + '{{WRAPPER}}' => '--ui-e-avatar-spacing: {{SIZE}}{{UNIT}}'
492 + ],
493 + ]
494 + );
495 + $this->add_group_control(
496 + Group_Control_Box_Shadow::get_type(),
497 + [
498 + 'name' => 'avatar_shadow',
499 + 'selector' => '{{WRAPPER}} .ui-e-testimonial-avatar img'
500 + ]
501 + );
502 + $this->add_control(
503 + 'avatar_offset_toggle',
504 + [
505 + 'label' => __('Offset', 'uicore-elements'),
506 + 'type' => Controls_Manager::POPOVER_TOGGLE,
507 + 'label_off' => __('None', 'uicore-elements'),
508 + 'label_on' => __('Custom', 'uicore-elements'),
509 + 'return_value' => 'yes',
510 + ]
511 + );
512 + $this->start_popover();
513 +
514 + $this->add_responsive_control(
515 + 'avatar_horizontal_offset',
516 + [
517 + 'label' => __('Horizontal', 'uicore-elements'),
518 + 'type' => Controls_Manager::SLIDER,
519 + 'default' => [
520 + 'size' => 0,
521 + ],
522 + 'tablet_default' => [
523 + 'size' => 0,
524 + ],
525 + 'mobile_default' => [
526 + 'size' => 0,
527 + ],
528 + 'range' => [
529 + 'px' => [
530 + 'min' => -200,
531 + 'max' => 200,
473 532 ],
474 - 'selectors' => [
475 - '{{WRAPPER}}' => '--ui-e-avatar-spacing: {{SIZE}}{{UNIT}}'
533 + ],
534 + 'condition' => [
535 + 'avatar_offset_toggle' => 'yes'
536 + ],
537 + 'render_type' => 'ui',
538 + 'selectors' => [
539 + '{{WRAPPER}}' => '--ui-e-avatar-h-offset: {{SIZE}}px;'
540 + ],
541 + ]
542 + );
543 + $this->add_responsive_control(
544 + 'avatar_vertical_offset',
545 + [
546 + 'label' => __('Vertical', 'uicore-elements'),
547 + 'type' => Controls_Manager::SLIDER,
548 + 'default' => [
549 + 'size' => 0,
550 + ],
551 + 'tablet_default' => [
552 + 'size' => 0,
553 + ],
554 + 'mobile_default' => [
555 + 'size' => 0,
556 + ],
557 + 'range' => [
558 + 'px' => [
559 + 'min' => -200,
560 + 'max' => 200,
476 561 ],
477 - ]
478 - );
479 - $this->add_group_control(
480 - Group_Control_Box_Shadow::get_type(),
481 - [
482 - 'name' => 'avatar_shadow',
483 - 'selector' => '{{WRAPPER}} .ui-e-testimonial-avatar img'
484 - ]
485 - );
486 - $this->add_control(
487 - 'avatar_offset_toggle',
488 - [
489 - 'label' => __('Offset', 'uicore-elements'),
490 - 'type' => Controls_Manager::POPOVER_TOGGLE,
491 - 'label_off' => __('None', 'uicore-elements'),
492 - 'label_on' => __('Custom', 'uicore-elements'),
493 - 'return_value' => 'yes',
494 - ]
495 - );
496 - $this->start_popover();
562 + ],
563 + 'condition' => [
564 + 'avatar_offset_toggle' => 'yes'
565 + ],
566 + 'render_type' => 'ui',
567 + 'selectors' => [
568 + '{{WRAPPER}}' => '--ui-e-avatar-v-offset: {{SIZE}}px;'
569 + ],
570 + ]
571 + );
572 + $this->end_popover();
497 573
498 - $this->add_responsive_control(
499 - 'avatar_horizontal_offset',
500 - [
501 - 'label' => __('Horizontal', 'uicore-elements'),
502 - 'type' => Controls_Manager::SLIDER,
503 - 'default' => [
504 - 'size' => 0,
505 - ],
506 - 'tablet_default' => [
507 - 'size' => 0,
508 - ],
509 - 'mobile_default' => [
510 - 'size' => 0,
511 - ],
512 - 'range' => [
513 - 'px' => [
514 - 'min' => -200,
515 - 'max' => 200,
516 - ],
517 - ],
518 - 'condition' => [
519 - 'avatar_offset_toggle' => 'yes'
520 - ],
521 - 'render_type' => 'ui',
522 - 'selectors' => [
523 - '{{WRAPPER}}' => '--ui-e-avatar-h-offset: {{SIZE}}px;'
524 - ],
525 - ]
526 - );
527 - $this->add_responsive_control(
528 - 'avatar_vertical_offset',
529 - [
530 - 'label' => __('Vertical', 'uicore-elements'),
531 - 'type' => Controls_Manager::SLIDER,
532 - 'default' => [
533 - 'size' => 0,
534 - ],
535 - 'tablet_default' => [
536 - 'size' => 0,
537 - ],
538 - 'mobile_default' => [
539 - 'size' => 0,
540 - ],
541 - 'range' => [
542 - 'px' => [
543 - 'min' => -200,
544 - 'max' => 200,
545 - ],
546 - ],
547 - 'condition' => [
548 - 'avatar_offset_toggle' => 'yes'
549 - ],
550 - 'render_type' => 'ui',
551 - 'selectors' => [
552 - '{{WRAPPER}}' => '--ui-e-avatar-v-offset: {{SIZE}}px;'
553 - ],
554 - ]
555 - );
556 - $this->end_popover();
557 -
558 574 $this->end_controls_section();
559 575 $this->start_controls_section(
560 576 'section_style_image',
561 577 [
@@ -565,115 +581,115 @@
565 581 'show_reviewer_image' => 'yes'
566 582 ]
567 583 ]
568 584 );
569 - $this->add_control(
570 - 'image_size',
571 - [
572 - 'label' => __('Size', 'uicore-elements'),
573 - 'type' => Controls_Manager::SLIDER,
574 - 'default' => [
575 - 'size' => 40,
576 - 'unit' => 'px'
585 + $this->add_responsive_control(
586 + 'image_size',
587 + [
588 + 'label' => __('Size', 'uicore-elements'),
589 + 'type' => Controls_Manager::SLIDER,
590 + 'default' => [
591 + 'size' => 40,
592 + 'unit' => 'px'
593 + ],
594 + 'range' => [
595 + 'px' => [
596 + 'min' => 10,
597 + 'max' => 500,
577 598 ],
578 - 'range' => [
579 - 'px' => [
580 - 'min' => 10,
581 - 'max' => 500,
582 - ],
583 - ],
584 - 'selectors' => [
585 - '{{WRAPPER}}' => '--ui-e-image-size: {{SIZE}}{{UNIT}};',
586 - ],
599 + ],
600 + 'selectors' => [
601 + '{{WRAPPER}}' => '--ui-e-image-size: {{SIZE}}{{UNIT}};',
602 + ],
603 + ]
604 + );
605 + $this->add_responsive_control(
606 + 'image_spacing',
607 + [
608 + 'label' => __('Spacing', 'uicore-elements'),
609 + 'type' => Controls_Manager::SLIDER,
610 + 'default' => [
611 + 'size' => 15,
612 + ],
613 + 'selectors' => [
614 + '{{WRAPPER}}' => '--ui-e-img-spacing: {{SIZE}}{{UNIT}}'
615 + ],
616 + 'condition' => [
617 + 'layout!' => ['layout_2', 'layout_4', 'layout_6'],
587 618 ]
588 - );
589 - $this->add_control(
590 - 'image_spacing',
591 - [
592 - 'label' => __('Spacing', 'uicore-elements'),
593 - 'type' => Controls_Manager::SLIDER,
594 - 'default' => [
595 - 'size' => 15,
619 + ]
620 + );
621 + $this->add_control(
622 + 'image_offset_toggle',
623 + [
624 + 'label' => __('Offset', 'uicore-elements'),
625 + 'type' => Controls_Manager::POPOVER_TOGGLE,
626 + 'label_off' => __('None', 'uicore-elements'),
627 + 'label_on' => __('Custom', 'uicore-elements'),
628 + 'return_value' => 'yes',
629 + ]
630 + );
631 + $this->start_popover();
632 +
633 + $this->add_responsive_control(
634 + 'image_horizontal_offset',
635 + [
636 + 'label' => __('Horizontal', 'uicore-elements'),
637 + 'type' => Controls_Manager::SLIDER,
638 + 'default' => [
639 + 'size' => 0,
640 + ],
641 + 'tablet_default' => [
642 + 'size' => 0,
643 + ],
644 + 'mobile_default' => [
645 + 'size' => 0,
646 + ],
647 + 'range' => [
648 + 'px' => [
649 + 'min' => -200,
650 + 'max' => 200,
596 651 ],
597 - 'selectors' => [
598 - '{{WRAPPER}}' => '--ui-e-img-spacing: {{SIZE}}{{UNIT}}'
652 + ],
653 + 'condition' => [
654 + 'image_offset_toggle' => 'yes'
655 + ],
656 + 'render_type' => 'ui',
657 + 'selectors' => [
658 + '{{WRAPPER}}' => '--ui-e-img-h-offset: {{SIZE}}px;'
659 + ],
660 + ]
661 + );
662 + $this->add_responsive_control(
663 + 'image_vertical_offset',
664 + [
665 + 'label' => __('Vertical', 'uicore-elements'),
666 + 'type' => Controls_Manager::SLIDER,
667 + 'default' => [
668 + 'size' => 0,
669 + ],
670 + 'tablet_default' => [
671 + 'size' => 0,
672 + ],
673 + 'mobile_default' => [
674 + 'size' => 0,
675 + ],
676 + 'range' => [
677 + 'px' => [
678 + 'min' => -200,
679 + 'max' => 200,
599 680 ],
600 - 'condition' => [
601 - 'layout!' => ['layout_2', 'layout_4', 'layout_6'],
602 - ]
603 - ]
604 - );
605 - $this->add_control(
606 - 'image_offset_toggle',
607 - [
608 - 'label' => __('Offset', 'uicore-elements'),
609 - 'type' => Controls_Manager::POPOVER_TOGGLE,
610 - 'label_off' => __('None', 'uicore-elements'),
611 - 'label_on' => __('Custom', 'uicore-elements'),
612 - 'return_value' => 'yes',
613 - ]
614 - );
615 - $this->start_popover();
616 -
617 - $this->add_responsive_control(
618 - 'image_horizontal_offset',
619 - [
620 - 'label' => __('Horizontal', 'uicore-elements'),
621 - 'type' => Controls_Manager::SLIDER,
622 - 'default' => [
623 - 'size' => 0,
624 - ],
625 - 'tablet_default' => [
626 - 'size' => 0,
627 - ],
628 - 'mobile_default' => [
629 - 'size' => 0,
630 - ],
631 - 'range' => [
632 - 'px' => [
633 - 'min' => -200,
634 - 'max' => 200,
635 - ],
636 - ],
637 - 'condition' => [
638 - 'image_offset_toggle' => 'yes'
639 - ],
640 - 'render_type' => 'ui',
641 - 'selectors' => [
642 - '{{WRAPPER}}' => '--ui-e-img-h-offset: {{SIZE}}px;'
643 - ],
644 - ]
645 - );
646 - $this->add_responsive_control(
647 - 'image_vertical_offset',
648 - [
649 - 'label' => __('Vertical', 'uicore-elements'),
650 - 'type' => Controls_Manager::SLIDER,
651 - 'default' => [
652 - 'size' => 0,
653 - ],
654 - 'tablet_default' => [
655 - 'size' => 0,
656 - ],
657 - 'mobile_default' => [
658 - 'size' => 0,
659 - ],
660 - 'range' => [
661 - 'px' => [
662 - 'min' => -200,
663 - 'max' => 200,
664 - ],
665 - ],
666 - 'condition' => [
667 - 'image_offset_toggle' => 'yes'
668 - ],
669 - 'render_type' => 'ui',
670 - 'selectors' => [
671 - '{{WRAPPER}}' => '--ui-e-img-v-offset: {{SIZE}}px;'
672 - ],
673 - ]
674 - );
675 - $this->end_popover();
681 + ],
682 + 'condition' => [
683 + 'image_offset_toggle' => 'yes'
684 + ],
685 + 'render_type' => 'ui',
686 + 'selectors' => [
687 + '{{WRAPPER}}' => '--ui-e-img-v-offset: {{SIZE}}px;'
688 + ],
689 + ]
690 + );
691 + $this->end_popover();
676 692 $this->end_controls_section();
677 693 }
678 694 function register_testimonial_name_controls()
679 695 {
@@ -687,59 +703,59 @@
687 703 ]
688 704 ]
689 705 );
690 706
691 - $this->add_control(
692 - 'name_color',
693 - [
694 - 'label' => __('Color', 'uicore-elements'),
695 - 'type' => Controls_Manager::COLOR,
696 - 'selectors' => [
697 - '{{WRAPPER}} .ui-e-testimonial-name' => 'color: {{VALUE}};',
707 + $this->add_control(
708 + 'name_color',
709 + [
710 + 'label' => __('Color', 'uicore-elements'),
711 + 'type' => Controls_Manager::COLOR,
712 + 'selectors' => [
713 + '{{WRAPPER}} .ui-e-testimonial-name' => 'color: {{VALUE}};',
714 + ],
715 + ]
716 + );
717 + $this->add_control(
718 + 'name_hover_color',
719 + [
720 + 'label' => __('Hover Color', 'uicore-elements'),
721 + 'type' => Controls_Manager::COLOR,
722 + 'selectors' => [
723 + '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-name' => 'color: {{VALUE}};',
724 + ],
725 + ]
726 + );
727 + $this->add_responsive_control(
728 + 'name_bottom_space',
729 + [
730 + 'label' => __('Spacing', 'uicore-elements'),
731 + 'type' => Controls_Manager::SLIDER,
732 + 'range' => [
733 + 'px' => [
734 + 'min' => 0,
735 + 'max' => 100,
698 736 ],
699 - ]
700 - );
701 - $this->add_control(
702 - 'name_hover_color',
703 - [
704 - 'label' => __('Hover Color', 'uicore-elements'),
705 - 'type' => Controls_Manager::COLOR,
706 - 'selectors' => [
707 - '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-name' => 'color: {{VALUE}};',
708 - ],
709 - ]
710 - );
711 - $this->add_control(
712 - 'name_bottom_space',
713 - [
714 - 'label' => __('Spacing', 'uicore-elements'),
715 - 'type' => Controls_Manager::SLIDER,
716 - 'range' => [
717 - 'px' => [
718 - 'min' => 0,
719 - 'max' => 100,
720 - ],
721 - ],
722 - 'selectors' => [
723 - '{{WRAPPER}} .ui-e-testimonial-name' => 'padding-bottom: {{SIZE}}{{UNIT}};',
724 - ],
725 - ]
726 - );
727 - $this->add_group_control(
728 - Group_Control_Typography::get_type(),
729 - [
730 - 'name' => 'name_typography',
731 - 'selector' => '{{WRAPPER}} .ui-e-testimonial-name',
732 - ]
733 - );
734 - $this->add_group_control(
735 - Group_Control_Text_Shadow::get_type(),
736 - [
737 - 'name' => 'name_shadow',
738 - 'label' => __( 'Text Shadow', 'uicore-elements' ),
739 - 'selector' => '{{WRAPPER}} .ui-e-testimonial-name',
740 - ]
741 - );
737 + ],
738 + 'selectors' => [
739 + '{{WRAPPER}} .ui-e-testimonial-name' => 'padding-bottom: {{SIZE}}{{UNIT}};',
740 + ],
741 + ]
742 + );
743 + $this->add_group_control(
744 + Group_Control_Typography::get_type(),
745 + [
746 + 'name' => 'name_typography',
747 + 'selector' => '{{WRAPPER}} .ui-e-testimonial-name',
748 + ]
749 + );
750 + $this->add_group_control(
751 + Group_Control_Text_Shadow::get_type(),
752 + [
753 + 'name' => 'name_shadow',
754 + 'label' => __('Text Shadow', 'uicore-elements'),
755 + 'selector' => '{{WRAPPER}} .ui-e-testimonial-name',
756 + ]
757 + );
742 758
743 759 $this->end_controls_section();
744 760 }
745 761 function register_testimonial_job_controls()
@@ -754,55 +770,55 @@
754 770 ]
755 771 ]
756 772 );
757 773
758 - $this->add_control(
759 - 'job_title_color',
760 - [
761 - 'label' => __('Color', 'uicore-elements'),
762 - 'type' => Controls_Manager::COLOR,
763 - 'selectors' => [
764 - '{{WRAPPER}} .ui-e-testimonial-job-title' => 'color: {{VALUE}};',
774 + $this->add_control(
775 + 'job_title_color',
776 + [
777 + 'label' => __('Color', 'uicore-elements'),
778 + 'type' => Controls_Manager::COLOR,
779 + 'selectors' => [
780 + '{{WRAPPER}} .ui-e-testimonial-job-title' => 'color: {{VALUE}};',
781 + ],
782 + ]
783 + );
784 + $this->add_control(
785 + 'job_title_hover_color',
786 + [
787 + 'label' => __('Hover Color', 'uicore-elements'),
788 + 'type' => Controls_Manager::COLOR,
789 + 'selectors' => [
790 + '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-job-title' => 'color: {{VALUE}};',
791 + ],
792 + ]
793 + );
794 + $this->add_responsive_control(
795 + 'job_title_bottom_space',
796 + [
797 + 'label' => __('Spacing', 'uicore-elements'),
798 + 'type' => Controls_Manager::SLIDER,
799 + 'range' => [
800 + 'px' => [
801 + 'min' => 0,
802 + 'max' => 100,
765 803 ],
766 - ]
767 - );
768 - $this->add_control(
769 - 'job_title_hover_color',
770 - [
771 - 'label' => __('Hover Color', 'uicore-elements'),
772 - 'type' => Controls_Manager::COLOR,
773 - 'selectors' => [
774 - '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-job-title' => 'color: {{VALUE}};',
775 - ],
776 - ]
777 - );
778 - $this->add_control(
779 - 'job_title_bottom_space',
780 - [
781 - 'label' => __('Spacing', 'uicore-elements'),
782 - 'type' => Controls_Manager::SLIDER,
783 - 'range' => [
784 - 'px' => [
785 - 'min' => 0,
786 - 'max' => 100,
787 - ],
788 - ],
789 - 'default' => [
790 - 'size' => 10,
791 - 'unit' => 'px'
792 - ],
793 - 'selectors' => [
794 - '{{WRAPPER}} .ui-e-testimonial-job-title' => 'padding-bottom: {{SIZE}}{{UNIT}};',
795 - ],
796 - ]
797 - );
798 - $this->add_group_control(
799 - Group_Control_Typography::get_type(),
800 - [
801 - 'name' => 'job_title_typography',
802 - 'selector' => '{{WRAPPER}} .ui-e-testimonial-job-title',
803 - ]
804 - );
804 + ],
805 + 'default' => [
806 + 'size' => 10,
807 + 'unit' => 'px'
808 + ],
809 + 'selectors' => [
810 + '{{WRAPPER}} .ui-e-testimonial-job-title' => 'padding-bottom: {{SIZE}}{{UNIT}};',
811 + ],
812 + ]
813 + );
814 + $this->add_group_control(
815 + Group_Control_Typography::get_type(),
816 + [
817 + 'name' => 'job_title_typography',
818 + 'selector' => '{{WRAPPER}} .ui-e-testimonial-job-title',
819 + ]
820 + );
805 821
806 822 $this->end_controls_section();
807 823 }
808 824 function register_testimonial_text_controls()
@@ -817,55 +833,55 @@
817 833 ]
818 834 ]
819 835 );
820 836
821 - $this->add_control(
822 - 'text_color',
823 - [
824 - 'label' => __('Color', 'uicore-elements'),
825 - 'type' => Controls_Manager::COLOR,
826 - 'selectors' => [
827 - '{{WRAPPER}} .ui-e-testimonial-text' => 'color: {{VALUE}};',
837 + $this->add_control(
838 + 'text_color',
839 + [
840 + 'label' => __('Color', 'uicore-elements'),
841 + 'type' => Controls_Manager::COLOR,
842 + 'selectors' => [
843 + '{{WRAPPER}} .ui-e-testimonial-text' => 'color: {{VALUE}};',
844 + ],
845 + ]
846 + );
847 + $this->add_control(
848 + 'text_hover_color',
849 + [
850 + 'label' => __('Hover Color', 'uicore-elements'),
851 + 'type' => Controls_Manager::COLOR,
852 + 'selectors' => [
853 + '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-text' => 'color: {{VALUE}};',
854 + ],
855 + ]
856 + );
857 + $this->add_group_control(
858 + Group_Control_Typography::get_type(),
859 + [
860 + 'name' => 'text_typography',
861 + 'selector' => '{{WRAPPER}} .ui-e-testimonial-text',
862 + ]
863 + );
864 + $this->add_responsive_control(
865 + 'text_bottom_space',
866 + [
867 + 'label' => __('Spacing', 'uicore-elements'),
868 + 'type' => Controls_Manager::SLIDER,
869 + 'range' => [
870 + 'px' => [
871 + 'min' => 0,
872 + 'max' => 100,
828 873 ],
829 - ]
830 - );
831 - $this->add_control(
832 - 'text_hover_color',
833 - [
834 - 'label' => __('Hover Color', 'uicore-elements'),
835 - 'type' => Controls_Manager::COLOR,
836 - 'selectors' => [
837 - '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-text' => 'color: {{VALUE}};',
838 - ],
839 - ]
840 - );
841 - $this->add_group_control(
842 - Group_Control_Typography::get_type(),
843 - [
844 - 'name' => 'text_typography',
845 - 'selector' => '{{WRAPPER}} .ui-e-testimonial-text',
846 - ]
847 - );
848 - $this->add_control(
849 - 'text_bottom_space',
850 - [
851 - 'label' => __('Spacing', 'uicore-elements'),
852 - 'type' => Controls_Manager::SLIDER,
853 - 'range' => [
854 - 'px' => [
855 - 'min' => 0,
856 - 'max' => 100,
857 - ],
858 - ],
859 - 'default' => [
860 - 'size' => 15,
861 - 'unit' => 'px'
862 - ],
863 - 'selectors' => [
864 - '{{WRAPPER}} .ui-e-testimonial-text' => 'padding-bottom: {{SIZE}}{{UNIT}};',
865 - ],
866 - ]
867 - );
874 + ],
875 + 'default' => [
876 + 'size' => 15,
877 + 'unit' => 'px'
878 + ],
879 + 'selectors' => [
880 + '{{WRAPPER}} .ui-e-testimonial-text' => 'padding-bottom: {{SIZE}}{{UNIT}};',
881 + ],
882 + ]
883 + );
868 884
869 885 $this->end_controls_section();
870 886 }
871 887 function register_testimonial_rating_controls()
@@ -880,75 +896,34 @@
880 896 ],
881 897 ]
882 898 );
883 899
884 - // If SVG inline, we only need one color control because the semi-star bg color hack is not enabled with this experiment
885 - if(Plugin::$instance->experiments->is_feature_active('e_font_icon_svg')) {
886 - $this->add_control(
887 - 'active_rating_color',
888 - [
889 - 'label' => esc_html__('Color', 'uicore-elements'),
890 - 'type' => Controls_Manager::COLOR,
891 - 'default' => '#ffab1a',
892 - 'selectors' => [
893 - '{{WRAPPER}} .ui-e-testimonial-rating svg' => 'fill: {{VALUE}};',
894 - ],
895 - 'condition' => [
896 - 'rating_type' => 'star',
897 - ],
898 - ]
899 - );
900 - // Without the experiment, two colors are usefull because <i> elements can be cut and printed as decimal-stars
901 - } else {
902 - $this->add_control(
903 - 'active_rating_color',
904 - [
905 - 'label' => esc_html__('Active Color', 'uicore-elements'),
906 - 'type' => Controls_Manager::COLOR,
907 - 'default' => '#ffab1a',
908 - 'selectors' => [
909 - '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-marked i' => 'color: {{VALUE}};',
910 - ],
911 - 'condition' => [
912 - 'rating_type' => 'star',
913 - ],
914 - ]
915 - );
916 - $this->add_control(
917 - 'rating_color',
918 - [
919 - 'label' => esc_html__('Color', 'uicore-elements'),
920 - 'type' => Controls_Manager::COLOR,
921 - 'default' => '#ccd6df',
922 - 'selectors' => [
923 - '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-unmarked i' => 'color: {{VALUE}};',
924 - ],
925 - 'condition' => [
926 - 'rating_type' => 'star',
927 - ],
928 - ]
929 - );
930 - }
900 + // If SVG inline, we only need one color control because the semi-star bg color hack is not enabled with this experiment
901 + if (Plugin::$instance->experiments->is_feature_active('e_font_icon_svg')) {
931 902 $this->add_control(
932 - 'rating_number_color',
903 + 'active_rating_color',
933 904 [
934 905 'label' => esc_html__('Color', 'uicore-elements'),
935 906 'type' => Controls_Manager::COLOR,
907 + 'default' => '#ffab1a',
936 908 'selectors' => [
937 - '{{WRAPPER}} .ui-e-testimonial-rating' => 'color: {{VALUE}};',
909 + '{{WRAPPER}} .ui-e-testimonial-rating svg' => 'fill: {{VALUE}};',
938 910 ],
939 911 'condition' => [
940 - 'rating_type' => 'number',
912 + 'rating_type' => 'star',
941 913 ],
942 914 ]
943 915 );
916 + // Without the experiment, two colors are usefull because <i> elements can be cut and printed as decimal-stars
917 + } else {
944 918 $this->add_control(
945 - 'rating_background',
919 + 'active_rating_color',
946 920 [
947 - 'label' => __( 'Background Color', 'uicore-elements' ),
948 - 'type' => Controls_Manager::COLOR,
921 + 'label' => esc_html__('Active Color', 'uicore-elements'),
922 + 'type' => Controls_Manager::COLOR,
923 + 'default' => '#ffab1a',
949 924 'selectors' => [
950 - '{{WRAPPER}} .ui-e-testimonial-rating' => 'background-color: {{VALUE}};',
925 + '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-marked i' => 'color: {{VALUE}};',
951 926 ],
952 927 'condition' => [
953 928 'rating_type' => 'star',
954 929 ],
@@ -954,99 +929,139 @@
954 929 ],
955 930 ]
956 931 );
957 932 $this->add_control(
958 - 'rating_number_background',
933 + 'rating_color',
959 934 [
960 - 'label' => __( 'Background Color', 'uicore-elements' ),
961 - 'type' => Controls_Manager::COLOR,
935 + 'label' => esc_html__('Color', 'uicore-elements'),
936 + 'type' => Controls_Manager::COLOR,
937 + 'default' => '#ccd6df',
962 938 'selectors' => [
963 - '{{WRAPPER}} .ui-e-testimonial-rating' => 'background-color: {{VALUE}};',
939 + '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-unmarked i' => 'color: {{VALUE}};',
964 940 ],
965 - 'global' => [
966 - 'default' => Global_Colors::COLOR_PRIMARY,
967 - ],
968 941 'condition' => [
969 - 'rating_type' => 'number',
942 + 'rating_type' => 'star',
970 943 ],
971 944 ]
972 945 );
946 + }
947 + $this->add_control(
948 + 'rating_number_color',
949 + [
950 + 'label' => esc_html__('Color', 'uicore-elements'),
951 + 'type' => Controls_Manager::COLOR,
952 + 'selectors' => [
953 + '{{WRAPPER}} .ui-e-testimonial-rating' => 'color: {{VALUE}};',
954 + ],
955 + 'condition' => [
956 + 'rating_type' => 'number',
957 + ],
958 + ]
959 + );
960 + $this->add_control(
961 + 'rating_background',
962 + [
963 + 'label' => __('Background Color', 'uicore-elements'),
964 + 'type' => Controls_Manager::COLOR,
965 + 'selectors' => [
966 + '{{WRAPPER}} .ui-e-testimonial-rating' => 'background-color: {{VALUE}};',
967 + ],
968 + 'condition' => [
969 + 'rating_type' => 'star',
970 + ],
971 + ]
972 + );
973 + $this->add_control(
974 + 'rating_number_background',
975 + [
976 + 'label' => __('Background Color', 'uicore-elements'),
977 + 'type' => Controls_Manager::COLOR,
978 + 'selectors' => [
979 + '{{WRAPPER}} .ui-e-testimonial-rating' => 'background-color: {{VALUE}};',
980 + ],
981 + 'default' => 'var(--e-global-color-uicore_primary)',
973 982
974 - $this->add_group_control(
975 - Group_Control_Border::get_type(),
976 - [
977 - 'name' => 'rating_border',
978 - 'selector' => '{{WRAPPER}} .ui-e-testimonial-rating',
979 - ]
980 - );
981 - $this->add_control(
982 - 'rating_border_radius',
983 - [
984 - 'label' => __( 'Border Radius', 'uicore-elements' ),
985 - 'type' => Controls_Manager::DIMENSIONS,
986 - 'size_units' => [ 'px', 'em', '%' ],
987 - 'selectors' => [
988 - '{{WRAPPER}} .ui-e-testimonial-rating' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
983 + 'condition' => [
984 + 'rating_type' => 'number',
985 + ],
986 + ]
987 + );
988 +
989 + $this->add_group_control(
990 + Group_Control_Border::get_type(),
991 + [
992 + 'name' => 'rating_border',
993 + 'selector' => '{{WRAPPER}} .ui-e-testimonial-rating',
994 + ]
995 + );
996 + $this->add_control(
997 + 'rating_border_radius',
998 + [
999 + 'label' => __('Border Radius', 'uicore-elements'),
1000 + 'type' => Controls_Manager::DIMENSIONS,
1001 + 'size_units' => ['px', 'em', '%'],
1002 + 'selectors' => [
1003 + '{{WRAPPER}} .ui-e-testimonial-rating' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1004 + ],
1005 + ]
1006 + );
1007 + $this->add_control(
1008 + 'rating_padding',
1009 + [
1010 + 'label' => esc_html__('Padding', 'uicore-elements'),
1011 + 'type' => Controls_Manager::DIMENSIONS,
1012 + 'size_units' => ['px', 'em', '%'],
1013 + 'selectors' => [
1014 + '{{WRAPPER}} .ui-e-testimonial-rating' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1015 + ],
1016 + ]
1017 + );
1018 + $this->add_control(
1019 + 'rating_margin',
1020 + [
1021 + 'label' => esc_html__('Margin', 'uicore-elements'),
1022 + 'type' => Controls_Manager::DIMENSIONS,
1023 + 'size_units' => ['px', '%'],
1024 + 'selectors' => [
1025 + '{{WRAPPER}} .ui-e-testimonial-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1026 + ],
1027 + ]
1028 + );
1029 + $this->add_control(
1030 + 'rating_size',
1031 + [
1032 + 'label' => esc_html__('Size', 'uicore-elements'),
1033 + 'type' => Controls_Manager::SLIDER,
1034 + 'default' => [
1035 + 'size' => 14,
1036 + 'unit' => 'px'
1037 + ],
1038 + 'selectors' => [
1039 + '{{WRAPPER}} .ui-e-testimonial-rating' => 'font-size: {{SIZE}}{{UNIT}};',
1040 + '{{WRAPPER}} .ui-e-testimonial-rating svg' => 'width: {{SIZE}}{{UNIT}};',
1041 + ],
1042 + ]
1043 + );
1044 + $this->add_control(
1045 + 'rating_space_between',
1046 + [
1047 + 'label' => esc_html__('Space Between', 'uicore-elements'),
1048 + 'type' => Controls_Manager::SLIDER,
1049 + 'range' => [
1050 + 'px' => [
1051 + 'min' => 0,
1052 + 'max' => 10,
989 1053 ],
990 - ]
991 - );
992 - $this->add_control(
993 - 'rating_padding',
994 - [
995 - 'label' => esc_html__('Padding', 'uicore-elements'),
996 - 'type' => Controls_Manager::DIMENSIONS,
997 - 'size_units' => ['px', 'em', '%'],
998 - 'selectors' => [
999 - '{{WRAPPER}} .ui-e-testimonial-rating' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1000 - ],
1001 - ]
1002 - );
1003 - $this->add_control(
1004 - 'rating_margin',
1005 - [
1006 - 'label' => esc_html__('Margin', 'uicore-elements'),
1007 - 'type' => Controls_Manager::DIMENSIONS,
1008 - 'size_units' => ['px', '%'],
1009 - 'selectors' => [
1010 - '{{WRAPPER}} .ui-e-testimonial-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1011 - ],
1012 - ]
1013 - );
1014 - $this->add_control(
1015 - 'rating_size',
1016 - [
1017 - 'label' => esc_html__('Size', 'uicore-elements'),
1018 - 'type' => Controls_Manager::SLIDER,
1019 - 'default' => [
1020 - 'size' => 14,
1021 - 'unit' => 'px'
1022 - ],
1023 - 'selectors' => [
1024 - '{{WRAPPER}} .ui-e-testimonial-rating' => 'font-size: {{SIZE}}{{UNIT}};',
1025 - '{{WRAPPER}} .ui-e-testimonial-rating svg' => 'width: {{SIZE}}{{UNIT}};',
1026 - ],
1027 - ]
1028 - );
1029 - $this->add_control(
1030 - 'rating_space_between',
1031 - [
1032 - 'label' => esc_html__('Space Between', 'uicore-elements'),
1033 - 'type' => Controls_Manager::SLIDER,
1034 - 'range' => [
1035 - 'px' => [
1036 - 'min' => 0,
1037 - 'max' => 10,
1038 - ],
1039 - ],
1040 - 'selectors' => [
1041 - '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-icon + .ui-e-icon' => 'margin-left: {{SIZE}}{{UNIT}};', // star type
1042 - '{{WRAPPER}} .ui-e-testimonial-rating span' => 'margin-right: {{SIZE}}{{UNIT}};', // number type
1043 - ],
1044 - 'condition' => [
1045 - 'rating_type' => 'star',
1046 - ],
1047 - ]
1048 - );
1054 + ],
1055 + 'selectors' => [
1056 + '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-icon + .ui-e-icon' => 'margin-left: {{SIZE}}{{UNIT}};', // star type
1057 + '{{WRAPPER}} .ui-e-testimonial-rating span' => 'margin-right: {{SIZE}}{{UNIT}};', // number type
1058 + ],
1059 + 'condition' => [
1060 + 'rating_type' => 'star',
1061 + ],
1062 + ]
1063 + );
1049 1064
1050 1065 $this->end_controls_section();
1051 1066 }
1052 1067 function register_testimonial_divider_controls()
@@ -1062,32 +1077,32 @@
1062 1077 ]
1063 1078 ]
1064 1079 );
1065 1080
1066 - $this->add_control(
1067 - 'divider_color',
1068 - [
1069 - 'label' => __('Color', 'uicore-elements'),
1070 - 'type' => Controls_Manager::COLOR,
1071 - 'selectors' => [
1072 - '{{WRAPPER}} .ui-e-testimonial-divider' => 'border-color: {{VALUE}};',
1073 - ],
1074 - ]
1075 - );
1076 - $this->add_control(
1077 - 'divider_spacing',
1078 - [
1079 - 'label' => __('Spacing', 'uicore-elements'),
1080 - 'type' => Controls_Manager::SLIDER,
1081 - 'default' => [
1082 - 'size' => 20,
1083 - 'unit' => 'px'
1084 - ],
1085 - 'selectors' => [
1086 - '{{WRAPPER}} .ui-e-testimonial-divider' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1087 - ],
1088 - ]
1089 - );
1081 + $this->add_control(
1082 + 'divider_color',
1083 + [
1084 + 'label' => __('Color', 'uicore-elements'),
1085 + 'type' => Controls_Manager::COLOR,
1086 + 'selectors' => [
1087 + '{{WRAPPER}} .ui-e-testimonial-divider' => 'border-color: {{VALUE}};',
1088 + ],
1089 + ]
1090 + );
1091 + $this->add_responsive_control(
1092 + 'divider_spacing',
1093 + [
1094 + 'label' => __('Spacing', 'uicore-elements'),
1095 + 'type' => Controls_Manager::SLIDER,
1096 + 'default' => [
1097 + 'size' => 20,
1098 + 'unit' => 'px'
1099 + ],
1100 + 'selectors' => [
1101 + '{{WRAPPER}} .ui-e-testimonial-divider' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1102 + ],
1103 + ]
1104 + );
1090 1105
1091 1106 $this->end_controls_section();
1092 1107 }
1093 1108
@@ -1145,23 +1160,23 @@
1145 1160 // Register specific Controls that can't be called in blocks because are positioned differently on widgets, or used only by specific testimonial types, such as grid or carousel
1146 1161 function TRAIT_register_specific_testimonial_controls($arg)
1147 1162 {
1148 1163
1149 - switch ($arg){
1150 - case 'layout' :
1164 + switch ($arg) {
1165 + case 'layout':
1151 1166 $this->add_control(
1152 1167 'layout',
1153 1168 [
1154 - 'label' => esc_html__( 'Layout', 'uicore-elements' ),
1169 + 'label' => esc_html__('Layout', 'uicore-elements'),
1155 1170 'type' => Controls_Manager::SELECT,
1156 1171 'default' => 'layout_1',
1157 1172 'options' => [
1158 - 'layout_1' => esc_html__( 'Layout 1', 'uicore-elements' ),
1159 - 'layout_2' => esc_html__( 'Layout 2', 'uicore-elements' ),
1160 - 'layout_3' => esc_html__( 'Layout 3', 'uicore-elements' ),
1161 - 'layout_4' => esc_html__( 'Layout 4', 'uicore-elements' ),
1162 - 'layout_5' => esc_html__( 'Layout 5', 'uicore-elements' ),
1163 - 'layout_6' => esc_html__( 'Layout 6', 'uicore-elements' ),
1173 + 'layout_1' => esc_html__('Layout 1', 'uicore-elements'),
1174 + 'layout_2' => esc_html__('Layout 2', 'uicore-elements'),
1175 + 'layout_3' => esc_html__('Layout 3', 'uicore-elements'),
1176 + 'layout_4' => esc_html__('Layout 4', 'uicore-elements'),
1177 + 'layout_5' => esc_html__('Layout 5', 'uicore-elements'),
1178 + 'layout_6' => esc_html__('Layout 6', 'uicore-elements'),
1164 1179 ],
1165 1180 'render_type' => 'template',
1166 1181 'prefix_class' => 'ui-e-',
1167 1182 'frontend_available' => true
@@ -1168,13 +1183,13 @@
1168 1183 ]
1169 1184 );
1170 1185 break;
1171 1186
1172 - case 'item_animations' :
1187 + case 'item_animations':
1173 1188 $this->add_control(
1174 1189 'item_hover_animation',
1175 1190 [
1176 - 'label' => esc_html__( 'Item Hover Animation', 'uicore-elements' ),
1191 + 'label' => esc_html__('Item Hover Animation', 'uicore-elements'),
1177 1192 'type' => Controls_Manager::SELECT,
1178 1193 'default' => '',
1179 1194 'label_block' => true,
1180 1195 'options' => $this->get_animations(),
@@ -1181,9 +1196,8 @@
1181 1196 ]
1182 1197 );
1183 1198 break;
1184 1199 }
1185 -
1186 1200 }
1187 1201
1188 1202 // HTML Rendering Functions
1189 1203 function render_reviewer_avatar($item)
@@ -1188,19 +1202,22 @@
1188 1202 // HTML Rendering Functions
1189 1203 function render_reviewer_avatar($item)
1190 1204 {
1191 1205 $settings = $this->get_settings_for_display();
1206 + $fit_avatar = ($this->is_option('avatar_size') && $settings['avatar_size']['unit'] === 'px')
1207 + ? 'ui-avatar-fit'
1208 + : '';
1192 1209
1193 - if ( ! $settings['show_reviewer_avatar'] ) {
1194 - return;
1195 - }
1210 + if (! $settings['show_reviewer_avatar']) {
1211 + return;
1212 + }
1196 1213
1197 - ?>
1198 - <div class="ui-e-testimonial-avatar <?php esc_attr_e($settings['avatar_animations']);?>">
1214 +?>
1215 + <div class="ui-e-testimonial-avatar <?php echo esc_attr($settings['avatar_animations']); ?> <?php echo esc_attr($fit_avatar); ?>">
1199 1216 <?php
1200 1217 $avatar_url = Group_Control_Image_Size::get_attachment_image_src($item['avatar']['id'], 'avatar_media_size', $settings);
1201 1218 if (!$avatar_url) {
1202 - printf('<img src="%1$s" alt="%2$s">', $item['avatar']['url'], esc_html($item['reviewer_name']));
1219 + printf('<img src="%1$s" alt="%2$s">', esc_url($item['avatar']['url']), esc_html($item['reviewer_name']));
1203 1220 } else {
1204 1221 print(wp_get_attachment_image(
1205 1222 $item['avatar']['id'],
1206 1223 $settings['avatar_media_size_size'],
@@ -1211,9 +1228,9 @@
1211 1228 ));
1212 1229 }
1213 1230 ?>
1214 1231 </div>
1215 - <?php
1232 + <?php
1216 1233 }
1217 1234 function render_reviewer_secondary_image($item)
1218 1235 {
1219 1236 $settings = $this->get_settings_for_display();
@@ -1219,14 +1236,14 @@
1219 1236 $settings = $this->get_settings_for_display();
1220 1237
1221 1238 $thumb_url = Group_Control_Image_Size::get_attachment_image_src($item['image']['id'], 'image_media_size', $settings);
1222 1239
1223 - if ( ! $settings['show_reviewer_image'] || !$thumb_url ) {
1224 - return;
1225 - }
1240 + if (! $settings['show_reviewer_image'] || !$thumb_url) {
1241 + return;
1242 + }
1226 1243
1227 - ?>
1228 - <div class="ui-e-testimonial-image <?php esc_attr_e($settings['image_animations']);?>">
1244 + ?>
1245 + <div class="ui-e-testimonial-image <?php echo esc_attr($settings['image_animations']); ?>">
1229 1246 <?php
1230 1247 if ($thumb_url) {
1231 1248 print(wp_get_attachment_image(
1232 1249 $item['image']['id'],
@@ -1236,54 +1253,54 @@
1236 1253 ));
1237 1254 }
1238 1255 ?>
1239 1256 </div>
1240 - <?php
1257 + <?php
1241 1258 }
1242 1259 function render_reviewer_name($item)
1243 1260 {
1244 1261 $settings = $this->get_settings_for_display();
1245 1262
1246 - if ( ! $settings['show_reviewer_name'] ) {
1247 - return;
1248 - }
1263 + if (! $settings['show_reviewer_name']) {
1264 + return;
1265 + }
1249 1266
1250 - ?>
1251 - <?php if ( $item['reviewer_name'] ) : ?>
1252 - <<?php esc_html_e($settings['review_name_tag']); ?> class="ui-e-testimonial-name <?php esc_attr_e($settings['name_animations']);?>">
1253 - <span><?php echo wp_kses_post($item['reviewer_name']);?></span>
1254 - </<?php esc_html_e($settings['review_name_tag']); ?>>
1267 + ?>
1268 + <?php if ($item['reviewer_name']) : ?>
1269 + <<?php echo Helper::esc_tag($settings['review_name_tag']); ?> class="ui-e-testimonial-name <?php echo esc_attr($settings['name_animations']); ?>">
1270 + <span><?php echo wp_kses_post($item['reviewer_name']); ?></span>
1271 + </<?php echo Helper::esc_tag($settings['review_name_tag']); ?>>
1255 1272 <?php endif; ?>
1256 - <?php
1273 + <?php
1257 1274 }
1258 1275 function render_reviewer_job_title($item)
1259 1276 {
1260 1277 $settings = $this->get_settings_for_display();
1261 1278
1262 - if ( ! $settings['show_reviewer_job_title'] ) {
1263 - return;
1264 - }
1279 + if (! $settings['show_reviewer_job_title']) {
1280 + return;
1281 + }
1265 1282
1266 - ?>
1267 - <?php if ( $item['reviewer_job_title'] ) : ?>
1268 - <div class="ui-e-testimonial-job-title <?php esc_attr_e($settings['job_animations']);?>">
1269 - <span><?php esc_html_e($item['reviewer_job_title']); ?></span>
1283 + ?>
1284 + <?php if ($item['reviewer_job_title']) : ?>
1285 + <div class="ui-e-testimonial-job-title <?php echo esc_attr($settings['job_animations']); ?>">
1286 + <span><?php echo esc_html($item['reviewer_job_title']); ?></span>
1270 1287 </div>
1271 1288 <?php endif; ?>
1272 - <?php
1289 + <?php
1273 1290 }
1274 1291 function render_review_text($item)
1275 1292 {
1276 1293 $settings = $this->get_settings_for_display();
1277 1294
1278 - if ( ! $settings['show_reviewer_text'] ) {
1279 - return;
1280 - }
1295 + if (! $settings['show_reviewer_text']) {
1296 + return;
1297 + }
1281 1298
1282 - ?>
1283 - <?php if ( $item['review_text'] ) : ?>
1284 - <div class="ui-e-testimonial-text <?php esc_attr_e($settings['text_animations']);?>">
1285 - <?php echo wp_kses_post( $item['review_text'] ); ?>
1299 + ?>
1300 + <?php if ($item['review_text']) : ?>
1301 + <div class="ui-e-testimonial-text <?php echo esc_attr($settings['text_animations']); ?>">
1302 + <?php echo wp_kses_post($this->parse_text_editor($item['review_text'])); ?>
1286 1303 </div>
1287 1304 <?php endif; ?>
1288 1305 <?php
1289 1306 }
@@ -1292,9 +1309,9 @@
1292 1309
1293 1310 $settings = $this->get_settings_for_display();
1294 1311
1295 1312 $ID = $item['_id'];
1296 - if ( !$settings['show_reviewer_rating'] ) {
1313 + if (!$settings['show_reviewer_rating']) {
1297 1314 return;
1298 1315 }
1299 1316
1300 1317 $rating_value = $item['rating_number']['size']; // get rating value
@@ -1300,79 +1317,81 @@
1300 1317 $rating_value = $item['rating_number']['size']; // get rating value
1301 1318
1302 1319 if ($settings['rating_type'] == 'star') {
1303 1320
1304 - ?>
1305 - <div class="ui-e-testimonial-rating <?php esc_attr_e($settings['rating_animations']);?>">
1321 + ?>
1322 + <div class="ui-e-testimonial-rating <?php echo esc_attr($settings['rating_animations']); ?>">
1306 1323 <?php
1307 1324
1308 1325 $rating_scale = 5;
1309 1326
1310 - if ( '' === $rating_value ) {
1327 + if ('' === $rating_value) {
1311 1328 $rating_value = $rating_scale;
1312 1329 }
1313 1330
1314 - $rating_value = floatval( $rating_value );
1315 - $rating_value = round( $rating_value, 2 );
1331 + $rating_value = floatval($rating_value);
1332 + $rating_value = round($rating_value, 2);
1316 1333
1317 - for ( $index = 1; $index <= $rating_scale; $index++ ) {
1334 + for ($index = 1; $index <= $rating_scale; $index++) {
1318 1335
1319 1336 // SVG Method (uses font-awesome library for it's half-star icon, and can prints full and half-star)
1320 - if (Plugin::$instance->experiments->is_feature_active('e_font_icon_svg')){
1321 - ?>
1337 + if (Plugin::$instance->experiments->is_feature_active('e_font_icon_svg')) {
1338 + ?>
1322 1339 <div class="ui-e-icon">
1323 1340 <?php
1324 - if ( $rating_value >= $index ) {
1325 - echo Icons_Manager::try_get_icon_html( ['value' => 'fas fa-star', 'library' => 'fa-solid'], [ 'aria-hidden' => 'true' ] );
1326 - } elseif ( intval( ceil( $rating_value ) ) === $index ) {
1327 - echo Icons_Manager::try_get_icon_html( ['value' => 'fas fa-star-half', 'library' => 'fa-solid'], ['aria-hidden' => 'true'] );
1328 - }
1341 + if ($rating_value >= $index) {
1342 + echo Icons_Manager::try_get_icon_html(['value' => 'fas fa-star', 'library' => 'fa-solid'], ['aria-hidden' => 'true']); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1343 + } elseif (intval(ceil($rating_value)) === $index) {
1344 + echo Icons_Manager::try_get_icon_html(['value' => 'fas fa-star-half', 'library' => 'fa-solid'], ['aria-hidden' => 'true']); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1345 + }
1329 1346 ?>
1330 1347 </div>
1331 - <?php
1332 - // Font Icon Method (uses elementor library and can print decimal specific stars)
1348 + <?php
1349 + // Font Icon Method (uses elementor library and can print decimal specific stars)
1333 1350 } else {
1334 1351
1335 - if ( $rating_value >= $index ) {
1352 + if ($rating_value >= $index) {
1336 1353 $width = '100%'; // Full star if rate superior to current loop
1337 - } elseif ( intval( ceil( $rating_value ) ) === $index ) {
1338 - $width = ( $rating_value - ( $index - 1 ) ) * 100 . '%'; // Semi-star, calculating the width based on the decimal value
1354 + } elseif (intval(ceil($rating_value)) === $index) {
1355 + $width = ($rating_value - ($index - 1)) * 100 . '%'; // Semi-star, calculating the width based on the decimal value
1339 1356 } else {
1340 1357 $width = '0%'; // No star if rate inferior to current loop
1341 1358 }
1342 1359
1343 1360 // Creates the atts
1344 - $this->add_render_attribute( "icon_marked_$ID" . "_$index", [
1361 + $this->add_render_attribute("icon_marked_$ID" . "_$index", [
1345 1362 'class' => 'ui-e-marked',
1346 - ] );
1347 - if ( '100%' !== $width ) {
1348 - $this->add_render_attribute( "icon_marked_$ID" . "_$index", [
1363 + ]);
1364 + if ('100%' !== $width) {
1365 + $this->add_render_attribute("icon_marked_$ID" . "_$index", [
1349 1366 'style' => '--ui-e-rate-width: ' . $width . ';',
1350 - ] );
1367 + ]);
1351 1368 }
1352 1369
1353 - ?>
1354 - <div class="ui-e-icon">
1355 - <div <?php $this->print_render_attribute_string( "icon_marked_$ID" . "_$index",); ?>>
1356 - <?php echo Icons_Manager::try_get_icon_html( ['value' => 'eicon-star','library' => 'eicons'], [ 'aria-hidden' => 'true' ] );?>
1357 - </div>
1358 - <div class="ui-e-unmarked">
1359 - <?php echo Icons_Manager::try_get_icon_html( ['value' => 'eicon-star','library' => 'eicons'], [ 'aria-hidden' => 'true' ] );?>
1360 - </div>
1370 + ?>
1371 + <div class="ui-e-icon">
1372 + <div <?php $this->print_render_attribute_string("icon_marked_$ID" . "_$index",); ?>>
1373 + <?php echo Icons_Manager::try_get_icon_html(['value' => 'eicon-star', 'library' => 'eicons'], ['aria-hidden' => 'true']); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1374 + ?>
1361 1375 </div>
1362 - <?php
1376 + <div class="ui-e-unmarked">
1377 + <?php echo Icons_Manager::try_get_icon_html(['value' => 'eicon-star', 'library' => 'eicons'], ['aria-hidden' => 'true']); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1378 + ?>
1379 + </div>
1380 + </div>
1381 + <?php
1363 1382 }
1364 1383 }
1365 1384 ?>
1366 1385 </div>
1367 - <?php
1386 + <?php
1368 1387
1369 1388 } else { // number type rating
1370 - ?>
1371 - <div class="ui-e-testimonial-rating number">
1372 - <span><?php esc_html_e($rating_value);?></span>
1373 - </div>
1374 - <?php
1389 + ?>
1390 + <div class="ui-e-testimonial-rating number">
1391 + <span><?php echo esc_html($rating_value); ?></span>
1392 + </div>
1393 + <?php
1375 1394 }
1376 1395 }
1377 1396 function render_review_divider()
1378 1397 {
@@ -1377,15 +1396,15 @@
1377 1396 function render_review_divider()
1378 1397 {
1379 1398 $settings = $this->get_settings_for_display();
1380 1399
1381 - if ( !$settings['show_reviewer_divider'] ) {
1400 + if (!$settings['show_reviewer_divider']) {
1382 1401 return;
1383 1402 }
1384 1403
1385 1404 ?>
1386 - <span class="ui-e-testimonial-divider"></span>
1387 - <?php
1405 + <span class="ui-e-testimonial-divider"></span>
1406 + <?php
1388 1407 }
1389 1408 function TRAIT_render_review_item($item, $layout)
1390 1409 {
1391 1410 $settings = $this->get_settings_for_display();
@@ -1391,14 +1410,14 @@
1391 1410 $settings = $this->get_settings_for_display();
1392 1411
1393 1412 // Atts used by some layouts
1394 1413 $atts = [
1395 - 'inline' => $settings['image_inline'] == 'yes' ? true : false,
1414 + 'inline' => $this->is_option('image_inline', 'yes') ? true : false,
1396 1415 ];
1397 1416
1398 1417 // Get entrance and item hover animation classes
1399 - $entrance = (isset($settings['animate_items']) && $settings['animate_items'] == 'ui-e-grid-animate') ? 'elementor-invisible' : '';
1400 - $hover = isset($settings['item_hover_animation']) ? $settings['item_hover_animation'] : null;
1418 + $entrance = $this->is_option('animate_items', 'ui-e-grid-animate') ? 'elementor-invisible' : '';
1419 + $hover = isset($settings['item_hover_animation']) ? $settings['item_hover_animation'] : null;
1401 1420 $animations = sprintf('%s %s', $entrance, $hover);
1402 1421
1403 1422 // Get all elements animation control options (triggered by .ui-e-animations-wrp:hover)
1404 1423 $animation_options = [
@@ -1413,37 +1432,36 @@
1413 1432 if (!str_contains($this->get_name(), 'slider')) {
1414 1433 $animation_options[] = $settings['item_hover_animation'];
1415 1434 }
1416 1435 // check if any of the animation are set
1417 - $has_animation = array_filter($animation_options, function($value) {
1436 + $has_animation = array_filter($animation_options, function ($value) {
1418 1437 return $value !== '';
1419 1438 });
1420 1439 // and also check if entrance is set
1421 1440 $has_animation = $entrance !== '' ? true : $has_animation;
1422 1441
1423 - // TODO: remove `ui-e-item-wrp`, at least, 2 releases after 1.0.6
1424 - ?>
1442 + ?>
1425 1443
1426 1444 <div class="ui-e-wrp swiper-slide">
1427 1445 <?php if (!empty($has_animation)) : ?>
1428 - <div class="ui-e-animations-wrp <?php echo esc_attr($animations);?>">
1429 - <?php endif; ?>
1430 - <div class="ui-e-item-wrp ui-e-item">
1446 + <div class="ui-e-animations-wrp <?php echo esc_attr($animations); ?>">
1447 + <?php endif; ?>
1448 + <div class="ui-e-item">
1431 1449 <?php
1432 - switch($layout){
1433 - case 'layout_2' :
1450 + switch ($layout) {
1451 + case 'layout_2':
1434 1452 $this->render_layout_2($item, $atts);
1435 1453 break;
1436 - case 'layout_3' :
1454 + case 'layout_3':
1437 1455 $this->render_layout_3($item, $atts);
1438 1456 break;
1439 - case 'layout_4' :
1457 + case 'layout_4':
1440 1458 $this->render_layout_4($item);
1441 1459 break;
1442 - case 'layout_5' :
1460 + case 'layout_5':
1443 1461 $this->render_layout_5($item);
1444 1462 break;
1445 - case 'layout_6' :
1463 + case 'layout_6':
1446 1464 $this->render_layout_6($item);
1447 1465 break;
1448 1466 default:
1449 1467 $this->render_layout_1($item, $atts);
@@ -1450,13 +1468,13 @@
1450 1468 break;
1451 1469 }
1452 1470 ?>
1453 1471 </div>
1454 - <?php if (!empty($has_animation)) : ?>
1472 + <?php if (!empty($has_animation)) : ?>
1455 1473 </div>
1456 1474 <?php endif; ?>
1457 1475 </div>
1458 - <?php
1476 + <?php
1459 1477 }
1460 1478
1461 1479 // Layouts
1462 1480 function render_layout_1($item, $atts)
@@ -1462,9 +1480,9 @@
1462 1480 function render_layout_1($item, $atts)
1463 1481 {
1464 1482
1465 1483 $this->render_reviewer_secondary_image($item);
1466 - ?>
1484 + ?>
1467 1485 <div class="ui-e-content">
1468 1486
1469 1487 <?php $this->render_review_text($item); ?>
1470 1488
@@ -1473,11 +1491,11 @@
1473 1491 <div class="ui-e-testimonial-flex">
1474 1492 <?php $this->render_reviewer_avatar($item); ?>
1475 1493 <div class="ui-e-inner-content">
1476 1494 <?php
1477 - $this->render_reviewer_name($item);
1478 - $this->render_reviewer_job_title($item);
1479 - $this->render_review_rating($item);
1495 + $this->render_reviewer_name($item);
1496 + $this->render_reviewer_job_title($item);
1497 + $this->render_review_rating($item);
1480 1498 ?>
1481 1499 </div>
1482 1500 </div>
1483 1501
@@ -1487,14 +1505,14 @@
1487 1505 $this->render_reviewer_job_title($item);
1488 1506 $this->render_review_rating($item);
1489 1507 endif; ?>
1490 1508
1491 - </div>
1492 - <?php
1509 + </div>
1510 + <?php
1493 1511 }
1494 1512 function render_layout_2($item, $atts)
1495 1513 {
1496 - ?>
1514 + ?>
1497 1515 <div class="ui-e-content">
1498 1516
1499 1517 <?php if ($atts['inline']) : ?>
1500 1518 <div class="ui-e-testimonial-flex">
@@ -1500,11 +1518,11 @@
1500 1518 <div class="ui-e-testimonial-flex">
1501 1519 <?php $this->render_reviewer_avatar($item); ?>
1502 1520 <div class="ui-e-inner-content">
1503 1521 <?php
1504 - $this->render_reviewer_name($item);
1505 - $this->render_reviewer_job_title($item);
1506 - $this->render_review_rating($item);
1522 + $this->render_reviewer_name($item);
1523 + $this->render_reviewer_job_title($item);
1524 + $this->render_review_rating($item);
1507 1525 ?>
1508 1526 </div>
1509 1527 </div>
1510 1528
@@ -1517,24 +1535,24 @@
1517 1535
1518 1536 <?php $this->render_review_text($item); ?>
1519 1537 </div>
1520 1538
1521 - <?php
1539 + <?php
1522 1540 $this->render_reviewer_secondary_image($item);
1523 1541 }
1524 1542 function render_layout_3($item, $atts)
1525 1543 {
1526 1544 $this->render_reviewer_secondary_image($item);
1527 - ?>
1545 + ?>
1528 1546 <div class="ui-e-content">
1529 1547
1530 1548 <?php
1531 - $this->render_review_rating($item);
1532 - $this->render_review_text($item);
1533 - $this->render_review_divider();
1549 + $this->render_review_rating($item);
1550 + $this->render_review_text($item);
1551 + $this->render_review_divider();
1534 1552 ?>
1535 1553
1536 - <?php if ($atts['inline']) :?>
1554 + <?php if ($atts['inline']) : ?>
1537 1555
1538 1556 <div class="ui-e-testimonial-flex">
1539 1557 <?php $this->render_reviewer_avatar($item); ?>
1540 1558 <div class="ui-e-inner-content">
@@ -1548,13 +1566,13 @@
1548 1566 $this->render_reviewer_name($item);
1549 1567 $this->render_reviewer_job_title($item);
1550 1568 endif; ?>
1551 1569 </div>
1552 - <?php
1570 + <?php
1553 1571 }
1554 1572 function render_layout_4($item)
1555 1573 {
1556 - ?>
1574 + ?>
1557 1575 <div class="ui-e-testimonial-flex">
1558 1576 <?php $this->render_reviewer_avatar($item); ?>
1559 1577 <?php $this->render_reviewer_secondary_image($item); ?>
1560 1578 </div>
@@ -1560,37 +1578,37 @@
1560 1578 </div>
1561 1579
1562 1580 <div class="ui-e-content">
1563 1581 <?php
1564 - $this->render_review_text($item);
1565 - $this->render_reviewer_name($item);
1566 - $this->render_reviewer_job_title($item);
1567 - $this->render_review_rating($item);
1582 + $this->render_review_text($item);
1583 + $this->render_reviewer_name($item);
1584 + $this->render_reviewer_job_title($item);
1585 + $this->render_review_rating($item);
1568 1586 ?>
1569 1587 </div>
1570 - <?php
1588 + <?php
1571 1589 }
1572 1590 function render_layout_5($item)
1573 1591 {
1574 - ?>
1592 + ?>
1575 1593 <div class="ui-e-testimonial-flex">
1576 1594 <div class="ui-e-content">
1577 1595
1578 1596 <?php
1579 - $this->render_reviewer_secondary_image($item);
1580 - $this->render_review_text($item);
1581 - $this->render_review_rating($item);
1582 - $this->render_reviewer_name($item);
1583 - $this->render_reviewer_job_title($item);
1597 + $this->render_reviewer_secondary_image($item);
1598 + $this->render_review_text($item);
1599 + $this->render_review_rating($item);
1600 + $this->render_reviewer_name($item);
1601 + $this->render_reviewer_job_title($item);
1584 1602 ?>
1585 1603 </div>
1586 1604 <?php $this->render_reviewer_avatar($item); ?>
1587 1605 </div>
1588 - <?php
1606 + <?php
1589 1607 }
1590 1608 function render_layout_6($item)
1591 1609 {
1592 - ?>
1610 + ?>
1593 1611 <div class="ui-e-testimonial-flex">
1594 1612
1595 1613 <?php $this->render_reviewer_avatar($item); ?>
1596 1614
@@ -1595,15 +1613,15 @@
1595 1613 <?php $this->render_reviewer_avatar($item); ?>
1596 1614
1597 1615 <div class="ui-e-content">
1598 1616 <?php
1599 - $this->render_reviewer_name($item);
1600 - $this->render_reviewer_job_title($item);
1601 - $this->render_review_rating($item);
1602 - $this->render_review_text($item);
1603 - $this->render_reviewer_secondary_image($item);
1617 + $this->render_reviewer_name($item);
1618 + $this->render_reviewer_job_title($item);
1619 + $this->render_review_rating($item);
1620 + $this->render_review_text($item);
1621 + $this->render_reviewer_secondary_image($item);
1604 1622 ?>
1605 1623 </div>
1606 1624 </div>
1607 - <?php
1625 +<?php
1608 1626 }
1609 -}
1627 +}