PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.84
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.84
4.11.84 4.11.83 4.11.82 4.11.80 4.11.81 4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-testimonials.php
premium-addons-for-elementor / widgets Last commit date
dep 3 weeks ago premium-banner.php 1 day ago premium-blog.php 2 weeks ago premium-button.php 2 weeks ago premium-carousel.php 2 weeks ago premium-contactform.php 2 weeks ago premium-countdown.php 2 weeks ago premium-counter.php 2 weeks ago premium-dual-header.php 2 weeks ago premium-fancytext.php 2 weeks ago premium-grid.php 2 weeks ago premium-icon-list.php 2 weeks ago premium-image-button.php 2 weeks ago premium-image-scroll.php 2 weeks ago premium-image-separator.php 2 weeks ago premium-lottie.php 2 weeks ago premium-maps.php 2 days ago premium-media-wheel.php 2 weeks ago premium-mobile-menu.php 2 weeks ago premium-modalbox.php 2 days ago premium-nav-menu.php 2 weeks ago premium-notifications.php 2 weeks ago premium-person.php 2 weeks ago premium-pinterest-feed.php 2 weeks ago premium-post-ticker.php 2 weeks ago premium-pricing-table.php 2 days ago premium-progressbar.php 2 weeks ago premium-search-form.php 2 days ago premium-svg-drawer.php 2 weeks ago premium-tcloud.php 2 weeks ago premium-testimonials.php 2 weeks ago premium-textual-showcase.php 2 weeks ago premium-tiktok-feed.php 2 weeks ago premium-title.php 2 days ago premium-videobox.php 2 weeks ago premium-vscroll.php 2 weeks ago premium-weather.php 2 weeks ago premium-world-clock.php 2 weeks ago
premium-testimonials.php
2178 lines
1 <?php
2 /**
3 * Premium Testimonials.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Modules\DynamicTags\Module as TagsModule;
10 use Elementor\Plugin;
11 use Elementor\Widget_Base;
12 use Elementor\Utils;
13 use Elementor\Control_Media;
14 use Elementor\Controls_Manager;
15 use Elementor\Repeater;
16 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
17 use Elementor\Group_Control_Image_Size;
18 use Elementor\Group_Control_Typography;
19 use Elementor\Group_Control_Css_Filter;
20 use Elementor\Group_Control_Border;
21 use Elementor\Group_Control_Text_Shadow;
22 use Elementor\Group_Control_Box_Shadow;
23 use PremiumAddons\Includes\Controls\Premium_Background;
24
25 // PremiumAddons Classes.
26 use PremiumAddons\Includes\Helper_Functions;
27
28 if ( ! defined( 'ABSPATH' ) ) {
29 exit; // If this file is called directly, abort.
30 }
31
32 /**
33 * Class Premium_Testimonials
34 */
35 class Premium_Testimonials extends Widget_Base {
36
37 /**
38 * Retrieve Widget Name.
39 *
40 * @since 1.0.0
41 * @access public
42 */
43 public function get_name() {
44 return 'premium-addon-testimonials';
45 }
46
47 /**
48 * Retrieve Widget Title.
49 *
50 * @since 1.0.0
51 * @access public
52 */
53 public function get_title() {
54 return __( 'Testimonial', 'premium-addons-for-elementor' );
55 }
56
57 /**
58 * Retrieve Widget Icon.
59 *
60 * @since 1.0.0
61 * @access public
62 *
63 * @return string widget icon.
64 */
65 public function get_icon() {
66 return 'pa-testimonials';
67 }
68
69 /**
70 * Retrieve Widget Dependent CSS.
71 *
72 * @since 1.0.0
73 * @access public
74 *
75 * @return array CSS style handles.
76 */
77 public function get_style_depends() {
78 return array(
79 'pa-glass',
80 'font-awesome-5-all',
81 'pa-slick',
82 'premium-addons',
83 );
84 }
85
86 /**
87 * Retrieve Widget Dependent JS.
88 *
89 * @since 1.0.0
90 * @access public
91 *
92 * @return array JS script handles.
93 */
94 public function get_script_depends() {
95
96 $is_edit = Helper_Functions::is_edit_mode();
97
98 $scripts = array();
99
100 if ( $is_edit ) {
101
102 $scripts = array( 'isotope-js', 'pa-glass', 'pa-slick' );
103
104 } else {
105 $settings = $this->get_settings();
106 $load_masonry = 'masonry' === $settings['premium_testimonial_layout'] && 'yes' !== $settings['carousel'] && 'skin4' !== $settings['skin'];
107
108 if ( 'yes' === $settings['carousel'] || 'skin4' === $settings['skin'] ) {
109 $scripts[] = 'pa-slick';
110
111 if ( 'none' !== $settings['arrows_lq_effect'] ) {
112 $scripts[] = 'pa-glass';
113 }
114 }
115
116 if ( $load_masonry ) {
117 $scripts[] = 'isotope-js';
118 }
119 }
120
121 $scripts[] = 'premium-addons';
122
123 return $scripts;
124 }
125
126 /**
127 * Retrieve Widget Categories.
128 *
129 * @since 1.5.1
130 * @access public
131 *
132 * @return array Widget categories.
133 */
134 public function get_categories() {
135 return array( 'premium-elements' );
136 }
137
138 /**
139 * Retrieve Widget Keywords.
140 *
141 * @since 1.0.0
142 * @access public
143 *
144 * @return array Widget keywords.
145 */
146 public function get_keywords() {
147 return array( 'pa', 'premium', 'premium testimonials', 'quote', 'appreciate', 'rating', 'review', 'recommendation' );
148 }
149
150 protected function is_dynamic_content(): bool {
151 return false;
152 }
153
154 /**
155 * Retrieve Widget Support URL.
156 *
157 * @access public
158 *
159 * @return string support URL.
160 */
161 public function get_custom_help_url() {
162 return 'https://premiumaddons.com/support/';
163 }
164
165 public function has_widget_inner_wrapper(): bool {
166 return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' );
167 }
168
169 /**
170 * Register Testimonials controls.
171 *
172 * @since 1.0.0
173 * @access protected
174 */
175 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
176
177 $papro_activated = Helper_Functions::check_papro_version();
178
179 $this->start_controls_section(
180 'testimonial_section',
181 array(
182 'label' => __( 'Testimonial', 'premium-addons-for-elementor' ),
183 )
184 );
185
186 $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/testimonials-widget-for-elementor-page-builder/', 'testimonials', 'wp-editor', 'demo' );
187 Helper_Functions::add_templates_controls( $this, 'testimonials', $demo );
188
189 $this->add_control(
190 'multiple',
191 array(
192 'label' => __( 'Multiple Testimonials', 'premium-addons-for-elementor' ),
193 'description' => __( 'Enable this option if you need to add multiple testimonials', 'premium-addons-for-elementor' ),
194 'type' => Controls_Manager::SWITCHER,
195 )
196 );
197
198 $this->start_controls_tabs(
199 'author_info_tabs',
200 array(
201 'condition' => array(
202 'multiple!' => 'yes',
203 ),
204 )
205 );
206
207 $this->start_controls_tab(
208 'author_info_tab_author',
209 array(
210 'label' => __( 'Author', 'premium-addons-for-elementor' ),
211 )
212 );
213
214 $this->add_control(
215 'premium_testimonial_person_image',
216 array(
217 'label' => __( 'Image', 'premium-addons-for-elementor' ),
218 'type' => Controls_Manager::MEDIA,
219 'dynamic' => array( 'active' => true ),
220 'default' => array(
221 'url' => Utils::get_placeholder_image_src(),
222 ),
223 'show_label' => true,
224 )
225 );
226
227 $this->add_control(
228 'premium_testimonial_person_name',
229 array(
230 'label' => __( 'Name', 'premium-addons-for-elementor' ),
231 'type' => Controls_Manager::TEXT,
232 'default' => 'Joseph L.Mabie',
233 'dynamic' => array( 'active' => true ),
234 'label_block' => true,
235 )
236 );
237
238 $this->end_controls_tab();
239
240 $this->start_controls_tab(
241 'author_info_tab_content',
242 array(
243 'label' => __( 'Content', 'premium-addons-for-elementor' ),
244 )
245 );
246
247 $this->add_control(
248 'heading',
249 array(
250 'label' => __( 'Heading', 'premium-addons-for-elementor' ),
251 'type' => Controls_Manager::TEXT,
252 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ),
253 'dynamic' => array( 'active' => true ),
254 'label_block' => true,
255 )
256 );
257
258 $this->add_control(
259 'premium_testimonial_company_name',
260 array(
261 'label' => __( 'Job', 'premium-addons-for-elementor' ),
262 'type' => Controls_Manager::TEXT,
263 'dynamic' => array( 'active' => true ),
264 'default' => 'Influencer',
265 'label_block' => true,
266 )
267 );
268
269 $this->add_control(
270 'premium_testimonial_company_link_switcher',
271 array(
272 'label' => __( 'Link', 'premium-addons-for-elementor' ),
273 'type' => Controls_Manager::SWITCHER,
274 'default' => 'yes',
275 )
276 );
277
278 $this->add_control(
279 'premium_testimonial_company_link',
280 array(
281 'label' => __( 'Link', 'premium-addons-for-elementor' ),
282 'type' => Controls_Manager::URL,
283 'default' => array(
284 'is_external' => true,
285 ),
286 'dynamic' => array( 'active' => true ),
287 'label_block' => true,
288 'condition' => array(
289 'premium_testimonial_company_link_switcher' => 'yes',
290 ),
291 )
292 );
293
294 $this->add_control(
295 'rating',
296 array(
297 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ),
298 'type' => Controls_Manager::NUMBER,
299 'dynamic' => array( 'active' => true ),
300 'min' => 0,
301 'max' => 5,
302 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ),
303 )
304 );
305
306 $this->add_control(
307 'premium_testimonial_content',
308 array(
309 'label' => __( 'Content', 'premium-addons-for-elementor' ),
310 'type' => Controls_Manager::TEXTAREA,
311 'rows' => 10,
312 'dynamic' => array( 'active' => true ),
313 'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. Risus commodo viverra maecenas accumsan lacus vel facilisis.', 'premium-addons-for-elementor' ),
314 'label_block' => true,
315 )
316 );
317
318 $this->end_controls_tab();
319
320 $this->end_controls_tabs();
321
322 $repeater = new Repeater();
323
324 $repeater->add_control(
325 'person_image',
326 array(
327 'label' => __( 'Image', 'premium-addons-for-elementor' ),
328 'type' => Controls_Manager::MEDIA,
329 'dynamic' => array( 'active' => true ),
330 'default' => array(
331 'url' => Utils::get_placeholder_image_src(),
332 ),
333 'show_label' => true,
334 )
335 );
336
337 $repeater->add_control(
338 'heading',
339 array(
340 'label' => __( 'Heading', 'premium-addons-for-elementor' ),
341 'type' => Controls_Manager::TEXT,
342 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ),
343 'dynamic' => array( 'active' => true ),
344 'label_block' => true,
345 )
346 );
347
348 $repeater->add_control(
349 'person_name',
350 array(
351 'label' => __( 'Name', 'premium-addons-for-elementor' ),
352 'type' => Controls_Manager::TEXT,
353 'dynamic' => array( 'active' => true ),
354 'default' => 'Joseph L.Mabie',
355 'label_block' => true,
356 )
357 );
358
359 $repeater->add_control(
360 'company_name',
361 array(
362 'label' => __( 'Job', 'premium-addons-for-elementor' ),
363 'type' => Controls_Manager::TEXT,
364 'dynamic' => array( 'active' => true ),
365 'default' => 'Influencer',
366 'label_block' => true,
367 )
368 );
369
370 $repeater->add_control(
371 'link_switcher',
372 array(
373 'label' => __( 'Link', 'premium-addons-for-elementor' ),
374 'type' => Controls_Manager::SWITCHER,
375 )
376 );
377
378 $repeater->add_control(
379 'link',
380 array(
381 'label' => __( 'Link', 'premium-addons-for-elementor' ),
382 'type' => Controls_Manager::URL,
383 'default' => array(
384 'is_external' => true,
385 ),
386 'label_block' => true,
387 'condition' => array(
388 'link_switcher' => 'yes',
389 ),
390 )
391 );
392
393 $repeater->add_control(
394 'rating',
395 array(
396 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ),
397 'type' => Controls_Manager::NUMBER,
398 'dynamic' => array( 'active' => true ),
399 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ),
400 'min' => 0,
401 'max' => 5,
402 )
403 );
404
405 $repeater->add_control(
406 'content',
407 array(
408 'label' => __( 'Content', 'premium-addons-for-elementor' ),
409 'type' => Controls_Manager::TEXTAREA,
410 'rows' => 10,
411 'dynamic' => array( 'active' => true ),
412 'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. Risus commodo viverra maecenas accumsan lacus vel facilisis.', 'premium-addons-for-elementor' ),
413 'label_block' => true,
414 )
415 );
416
417 $this->add_control(
418 'multiple_testimonials',
419 array(
420 'label' => __( 'Testimonials', 'premium-addons-for-elementor' ),
421 'type' => Controls_Manager::REPEATER,
422 'default' => array(
423 array(
424 'person_name' => 'Joseph L.Mabie',
425 'company_name' => 'Influencer',
426 'heading' => 'Great Support Team',
427 ),
428 array(
429 'person_name' => 'Debra Campbell',
430 'company_name' => 'Web Developer',
431 'heading' => 'Very Powerful',
432 ),
433 array(
434 'person_name' => 'Joanne Ellis',
435 'company_name' => 'Content Creator',
436 'heading' => 'Excellent Service',
437 ),
438 ),
439 'fields' => $repeater->get_controls(),
440 'title_field' => '{{{person_name}}}',
441 'condition' => array(
442 'multiple' => 'yes',
443 ),
444 )
445 );
446
447 $this->add_control(
448 'carousel',
449 array(
450 'label' => __( 'Carousel', 'premium-addons-for-elementor' ),
451 'type' => Controls_Manager::SWITCHER,
452 'frontend_available' => true,
453 'condition' => array(
454 'multiple' => 'yes',
455 'skin!' => 'skin4',
456 ),
457 )
458 );
459
460 $this->add_responsive_control(
461 'slides_to_scroll',
462 array(
463 'label' => __( 'Slides To Scroll', 'premium-addons-for-elementor' ),
464 'type' => Controls_Manager::NUMBER,
465 'render_type' => 'template',
466 'selectors' => array(
467 '{{WRAPPER}}' => '--pa-carousel-slides: {{VALUE}}',
468 ),
469 'condition' => array(
470 'multiple' => 'yes',
471 'carousel' => 'yes',
472 'skin!' => 'skin4',
473 ),
474 )
475 );
476
477 $this->add_control(
478 'carousel_play',
479 array(
480 'label' => __( 'Auto Play', 'premium-addons-for-elementor' ),
481 'type' => Controls_Manager::SWITCHER,
482 'conditions' => array(
483 'terms' => array(
484 array(
485 'name' => 'multiple',
486 'value' => 'yes',
487 ),
488 array(
489 'relation' => 'or',
490 'terms' => array(
491 array(
492 'terms' => array(
493 array(
494 'name' => 'skin',
495 'operator' => '!==',
496 'value' => 'skin4',
497 ),
498 array(
499 'name' => 'carousel',
500 'operator' => '===',
501 'value' => 'yes',
502 ),
503 ),
504 ),
505 array(
506 'terms' => array(
507 array(
508 'name' => 'skin',
509 'operator' => '===',
510 'value' => 'skin4',
511 ),
512 ),
513 ),
514
515 ),
516 ),
517 ),
518 ),
519 'frontend_available' => true,
520 )
521 );
522
523 $this->add_control(
524 'speed',
525 array(
526 'label' => __( 'Autoplay Speed', 'premium-addons-for-elementor' ),
527 'description' => __( 'Autoplay Speed means at which time the next slide should come. Set a value in milliseconds (ms)', 'premium-addons-for-elementor' ),
528 'type' => Controls_Manager::NUMBER,
529 'default' => 5000,
530 'conditions' => array(
531 'terms' => array(
532 array(
533 'name' => 'multiple',
534 'value' => 'yes',
535 ),
536 array(
537 'name' => 'carousel_play',
538 'value' => 'yes',
539 ),
540 array(
541 'relation' => 'or',
542 'terms' => array(
543 array(
544 'terms' => array(
545 array(
546 'name' => 'skin',
547 'operator' => '!==',
548 'value' => 'skin4',
549 ),
550 array(
551 'name' => 'carousel',
552 'operator' => '===',
553 'value' => 'yes',
554 ),
555 ),
556 ),
557 array(
558 'terms' => array(
559 array(
560 'name' => 'skin',
561 'operator' => '===',
562 'value' => 'skin4',
563 ),
564 ),
565 ),
566
567 ),
568 ),
569 ),
570 ),
571 'frontend_available' => true,
572 )
573 );
574
575 $this->end_controls_section();
576
577 $this->start_controls_section(
578 'display_option_section',
579 array(
580 'label' => __( 'Display Options', 'premium-addons-for-elementor' ),
581 )
582 );
583
584 $this->add_control(
585 'skin',
586 array(
587 'label' => __( 'Choose Skin', 'premium-addons-for-elementor' ),
588 'type' => Controls_Manager::SELECT,
589 'default' => 'skin1',
590 'options' => array(
591 'skin1' => apply_filters( 'pa_pro_label', __( 'Skin 1', 'premium-addons-for-elementor' ) ),
592 'skin2' => apply_filters( 'pa_pro_label', __( 'Skin 2 (Pro)', 'premium-addons-for-elementor' ) ),
593 'skin3' => apply_filters( 'pa_pro_label', __( 'Skin 3 (Pro)', 'premium-addons-for-elementor' ) ),
594 'skin4' => apply_filters( 'pa_pro_label', __( 'Skin 4 (Pro)', 'premium-addons-for-elementor' ) ),
595 ),
596 'prefix_class' => 'premium-testimonial__',
597 'label_block' => true,
598 'render_type' => 'template',
599 'frontend_available' => true,
600 )
601 );
602
603 if ( ! $papro_activated ) {
604
605 $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'testimonials-widget', 'wp-editor', 'get-pro' );
606
607 $this->add_control(
608 'pro_skins_notice',
609 array(
610 'type' => Controls_Manager::RAW_HTML,
611 'raw' => __( 'This option is available in Premium Addons Pro. ', 'premium-addons-for-elementor' ) . '<a href="' . esc_url( $get_pro ) . '" target="_blank">' . __( 'Upgrade now!', 'premium-addons-for-elementor' ) . '</a>',
612 'content_classes' => 'papro-upgrade-notice',
613 'condition' => array(
614 'skin!' => 'skin1',
615 ),
616 )
617 );
618
619 }
620
621 $this->add_control(
622 'skin_notice',
623 array(
624 'raw' => __( 'This skin can be used with four or more testimonials.', 'premium-addons-for-elementor' ),
625 'type' => Controls_Manager::RAW_HTML,
626 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
627 'condition' => array(
628 'multiple' => 'yes',
629 'skin' => 'skin4',
630 ),
631 )
632 );
633
634 $this->add_control(
635 'show_image',
636 array(
637 'label' => __( 'Show Author Image', 'premium-addons-for-elementor' ),
638 'type' => Controls_Manager::SWITCHER,
639 'default' => 'yes',
640 'condition' => array(
641 'skin!' => 'skin4',
642 ),
643 )
644 );
645
646 $this->add_control(
647 'img_position',
648 array(
649 'label' => __( 'Image Position', 'premium-addons-for-elementor' ),
650 'type' => Controls_Manager::SELECT,
651 'options' => array(
652 'relative' => __( 'Relative', 'premium-addons-for-elementor' ),
653 'absolute' => __( 'Absolute', 'premium-addons-for-elementor' ),
654 ),
655 'default' => 'relative',
656 'label_block' => true,
657 'frontend_available' => true,
658 'condition' => array(
659 'show_image' => 'yes',
660 'skin' => 'skin1',
661 ),
662 )
663 );
664
665 $this->add_control(
666 'img_place',
667 array(
668 'label' => __( 'Select Position', 'premium-addons-for-elementor' ),
669 'type' => Controls_Manager::CHOOSE,
670 'options' => array(
671 'top' => array(
672 'title' => __( 'Top', 'premium-addons-for-elementor' ),
673 'icon' => 'eicon-flex eicon-justify-start-h premium-rotate-icon',
674 ),
675 'bottom' => array(
676 'title' => __( 'Bottom', 'premium-addons-for-elementor' ),
677 'icon' => 'eicon-flex eicon-justify-end-h premium-rotate-icon',
678 ),
679 ),
680 'default' => 'top',
681 'prefix_class' => 'premium-testimonial__img-',
682 'label_block' => true,
683 'condition' => array(
684 'show_image' => 'yes',
685 'skin' => 'skin1',
686 'img_position' => 'absolute',
687 ),
688 )
689 );
690
691 if ( $papro_activated ) {
692
693 do_action( 'pa_testimonials_skins_options', $this );
694
695 }
696
697 $this->add_control(
698 'premium_testimonial_person_name_size',
699 array(
700 'label' => __( 'Name HTML Tag', 'premium-addons-for-elementor' ),
701 'type' => Controls_Manager::SELECT,
702 'options' => array(
703 'h1' => 'H1',
704 'h2' => 'H2',
705 'h3' => 'H3',
706 'h4' => 'H4',
707 'h5' => 'H5',
708 'h6' => 'H6',
709 'div' => 'div',
710 'span' => 'span',
711 'p' => 'p',
712 ),
713 'default' => 'h3',
714 'separator' => 'before',
715 'label_block' => true,
716 )
717 );
718
719 $this->add_control(
720 'premium_testimonial_company_name_size',
721 array(
722 'label' => __( 'Job HTML Tag', 'premium-addons-for-elementor' ),
723 'type' => Controls_Manager::SELECT,
724 'options' => array(
725 'h1' => 'H1',
726 'h2' => 'H2',
727 'h3' => 'H3',
728 'h4' => 'H4',
729 'h5' => 'H5',
730 'h6' => 'H6',
731 'div' => 'div',
732 'span' => 'span',
733 'p' => 'p',
734 ),
735 'default' => 'h4',
736 'label_block' => true,
737 )
738 );
739
740 $this->add_control(
741 'icon_style',
742 array(
743 'label' => __( 'Quotation Skin', 'premium-addons-for-elementor' ),
744 'type' => Controls_Manager::SELECT,
745 'options' => array(
746 'rounded' => __( 'Rounded', 'premium-addons-for-elementor' ),
747 'sharp' => __( 'Sharp', 'premium-addons-for-elementor' ),
748 ),
749 'default' => 'rounded',
750 'label_block' => true,
751 )
752 );
753
754 $this->add_control(
755 'premium_testimonial_layout',
756 array(
757 'label' => esc_html__( 'Layout', 'premium-addons-for-elementor' ),
758 'type' => Controls_Manager::CHOOSE,
759 'render_type' => 'template',
760 'separator' => 'before',
761 'options' => array(
762 'grid' => array(
763 'title' => esc_html__( 'Grid', 'premium-addons-for-elementor' ),
764 'icon' => 'eicon-gallery-grid',
765 ),
766 'masonry' => array(
767 'title' => esc_html__( 'Masonry', 'premium-addons-for-elementor' ),
768 'icon' => 'eicon-gallery-masonry',
769 ),
770 ),
771 'label_block' => true,
772 'frontend_available' => true,
773 'default' => 'grid',
774 'condition' => array(
775 'multiple' => 'yes',
776 'skin!' => 'skin4',
777 'carousel!' => 'yes',
778 ),
779 )
780 );
781
782 $this->add_responsive_control(
783 'testimonials_per_row',
784 array(
785 'label' => __( 'Members/Row', 'premium-addons-for-elementor' ),
786 'type' => Controls_Manager::SELECT,
787 'options' => array(
788 '100%' => __( '1 Column', 'premium-addons-for-elementor' ),
789 '50%' => __( '2 Columns', 'premium-addons-for-elementor' ),
790 '33.33%' => __( '3 Columns', 'premium-addons-for-elementor' ),
791 '25%' => __( '4 Columns', 'premium-addons-for-elementor' ),
792 '20%' => __( '5 Columns', 'premium-addons-for-elementor' ),
793 '16.667%' => __( '6 Columns', 'premium-addons-for-elementor' ),
794 ),
795 'default' => '33.33%',
796 'tablet_default' => '100%',
797 'mobile_default' => '100%',
798 'render_type' => 'template',
799 'selectors' => array(
800 '{{WRAPPER}} .premium-testimonial-container' => 'width: {{VALUE}}',
801 ),
802 'separator' => 'before',
803 'condition' => array(
804 'multiple' => 'yes',
805 'skin!' => 'skin4',
806 ),
807 'frontend_available' => true,
808 )
809 );
810
811 $this->add_responsive_control(
812 'spacing',
813 array(
814 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
815 'type' => Controls_Manager::DIMENSIONS,
816 'size_units' => array( 'px', '%', 'em' ),
817 'default' => array(
818 'top' => 5,
819 'right' => 5,
820 'bottom' => 5,
821 'left' => 5,
822 ),
823 'condition' => array(
824 'multiple' => 'yes',
825 ),
826 'selectors' => array(
827 '{{WRAPPER}} .premium-testimonial-container' => 'padding: 0 {{RIGHT}}{{UNIT}} 0 {{LEFT}}{{UNIT}}; margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0',
828 ),
829 )
830 );
831
832 $this->add_control(
833 'spacing_notice',
834 array(
835 'raw' => __( 'Note, you may need to give a top/bottom spacing if you are not seeing the whole quotation icon or the author image.', 'premium-addons-for-elementor' ),
836 'type' => Controls_Manager::RAW_HTML,
837 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
838 )
839 );
840
841 $this->add_control(
842 'equal_height',
843 array(
844 'label' => __( 'Equal Height', 'premium-addons-for-elementor' ),
845 'type' => Controls_Manager::SWITCHER,
846 'render_type' => 'template',
847 'description' => __( 'This option searches for the testimonial with the largest height and applies that height to the other testimonials', 'premium-addons-for-elementor' ),
848 'prefix_class' => 'premium-testimonial__equal-',
849 'conditions' => array(
850 'relation' => 'and',
851 'terms' => array(
852 array(
853 'name' => 'multiple',
854 'operator' => '===',
855 'value' => 'yes',
856 ),
857 array(
858 'relation' => 'or',
859 'terms' => array(
860 array(
861 'name' => 'premium_testimonial_layout',
862 'operator' => '!==',
863 'value' => 'masonry',
864 ),
865 array(
866 'name' => 'carousel',
867 'operator' => '===',
868 'value' => 'yes',
869 ),
870 ),
871 ),
872 ),
873 ),
874 )
875 );
876
877 $this->end_controls_section();
878
879 $this->start_controls_section(
880 'section_pa_docs',
881 array(
882 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
883 )
884 );
885
886 $doc_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/why-im-not-able-to-see-elementor-font-awesome-5-icons-in-premium-add-ons', 'testimonials-widget', 'wp-editor', 'get-support' );
887 $title = __( 'I\'m not able to see Font Awesome icons in the widget »', 'premium-addons-for-elementor' );
888
889 $this->add_control(
890 'doc_1',
891 array(
892 'type' => Controls_Manager::RAW_HTML,
893 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
894 'content_classes' => 'editor-pa-doc',
895 )
896 );
897
898 Helper_Functions::register_element_feedback_controls( $this );
899
900 $this->end_controls_section();
901
902 Helper_Functions::register_papro_promotion_controls( $this, 'testimonials' );
903
904 $this->start_controls_section(
905 'premium_testimonial_image_style',
906 array(
907 'label' => __( 'Author Image', 'premium-addons-for-elementor' ),
908 'tab' => Controls_Manager::TAB_STYLE,
909 'condition' => array(
910 'show_image' => 'yes',
911 ),
912 )
913 );
914
915 $this->add_control(
916 'premium_testimonial_img_size',
917 array(
918 'label' => __( 'Size', 'premium-addons-for-elementor' ),
919 'type' => Controls_Manager::SLIDER,
920 'size_units' => array( 'px', 'em' ),
921 'default' => array(
922 'unit' => 'px',
923 'size' => 100,
924 ),
925 'range' => array(
926 'px' => array(
927 'min' => 10,
928 'max' => 150,
929 ),
930 ),
931 'selectors' => array(
932 '{{WRAPPER}} .premium-testimonial-img-wrapper' => 'width: {{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}}',
933 '{{WRAPPER}} .premium-testimonial__carousel' => 'width: calc( 3 * {{SIZE}}{{UNIT}} )',
934 ),
935 )
936 );
937
938 $this->add_group_control(
939 Group_Control_Border::get_type(),
940 array(
941 'name' => 'img_border',
942 'selector' => '{{WRAPPER}} .premium-testimonial-img-wrapper',
943 )
944 );
945
946 $this->add_control(
947 'active_border',
948 array(
949 'label' => __( 'Active Border Color', 'premium-addons-for-elementor' ),
950 'type' => Controls_Manager::COLOR,
951 'selectors' => array(
952 '{{WRAPPER}} .slick-center .premium-testimonial-img-wrapper' => 'border-color: {{VALUE}} !important',
953 ),
954 'condition' => array(
955 'multiple' => 'yes',
956 'skin' => 'skin4',
957 ),
958 )
959 );
960
961 $this->add_control(
962 'img_border_radius',
963 array(
964 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
965 'type' => Controls_Manager::SLIDER,
966 'size_units' => array( 'px', '%', 'em' ),
967 'selectors' => array(
968 '{{WRAPPER}} .premium-testimonial-img-wrapper' => 'border-radius: {{SIZE}}{{UNIT}};',
969 ),
970 )
971 );
972
973 $this->add_group_control(
974 Group_Control_Css_Filter::get_type(),
975 array(
976 'name' => 'css_filters',
977 'selector' => '{{WRAPPER}} .premium-testimonial-img-wrapper',
978 )
979 );
980
981 $this->add_group_control(
982 Group_Control_Css_Filter::get_type(),
983 array(
984 'name' => 'hover_css_filters',
985 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ),
986 'selector' => '{{WRAPPER}} .premium-testimonial-container:hover .premium-testimonial-img-wrapper',
987 )
988 );
989
990 $this->end_controls_section();
991
992 $this->start_controls_section(
993 'heading_style_section',
994 array(
995 'label' => __( 'Heading', 'premium-addons-for-elementor' ),
996 'tab' => Controls_Manager::TAB_STYLE,
997 )
998 );
999
1000 $this->add_control(
1001 'heading_color',
1002 array(
1003 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1004 'type' => Controls_Manager::COLOR,
1005 'global' => array(
1006 'default' => Global_Colors::COLOR_SECONDARY,
1007 ),
1008 'selectors' => array(
1009 '{{WRAPPER}} .premium-testimonial-heading' => 'color: {{VALUE}};',
1010 ),
1011 )
1012 );
1013
1014 $this->add_group_control(
1015 Group_Control_Typography::get_type(),
1016 array(
1017 'name' => 'heading_typography',
1018 'selector' => '{{WRAPPER}} .premium-testimonial-heading',
1019 )
1020 );
1021
1022 $this->add_group_control(
1023 Group_Control_Text_Shadow::get_type(),
1024 array(
1025 'name' => 'heading_shadow',
1026 'selector' => '{{WRAPPER}} .premium-testimonial-heading',
1027 )
1028 );
1029
1030 $this->add_responsive_control(
1031 'heading_margin',
1032 array(
1033 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1034 'type' => Controls_Manager::DIMENSIONS,
1035 'size_units' => array( 'px', 'em', '%' ),
1036 'selectors' => array(
1037 '{{WRAPPER}} .premium-testimonial-heading' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};',
1038 ),
1039 )
1040 );
1041
1042 $this->end_controls_section();
1043
1044 $this->start_controls_section(
1045 'person_style_section',
1046 array(
1047 'label' => __( 'Author', 'premium-addons-for-elementor' ),
1048 'tab' => Controls_Manager::TAB_STYLE,
1049 )
1050 );
1051
1052 $this->add_control(
1053 'premium_testimonial_person_name_color',
1054 array(
1055 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1056 'type' => Controls_Manager::COLOR,
1057 'selectors' => array(
1058 '{{WRAPPER}} .premium-testimonial-person-name' => 'color: {{VALUE}};',
1059 ),
1060 )
1061 );
1062
1063 $this->add_group_control(
1064 Group_Control_Typography::get_type(),
1065 array(
1066 'name' => 'author_name_typography',
1067 'selector' => '{{WRAPPER}} .premium-testimonial-person-name',
1068 )
1069 );
1070
1071 $this->add_group_control(
1072 Group_Control_Text_Shadow::get_type(),
1073 array(
1074 'name' => 'author_name_shadow',
1075 'selector' => '{{WRAPPER}} .premium-testimonial-person-name',
1076 )
1077 );
1078
1079 $this->add_responsive_control(
1080 'name_margin',
1081 array(
1082 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1083 'type' => Controls_Manager::DIMENSIONS,
1084 'size_units' => array( 'px', 'em', '%' ),
1085 'selectors' => array(
1086 '{{WRAPPER}} .premium-testimonial-person-name' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};',
1087 ),
1088 )
1089 );
1090
1091 $this->end_controls_section();
1092
1093 $this->start_controls_section(
1094 'company_style_section',
1095 array(
1096 'label' => __( 'Job', 'premium-addons-for-elementor' ),
1097 'tab' => Controls_Manager::TAB_STYLE,
1098 )
1099 );
1100
1101 $this->add_responsive_control(
1102 'job_align',
1103 array(
1104 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
1105 'type' => Controls_Manager::CHOOSE,
1106 'options' => array(
1107 'flex-start' => array(
1108 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1109 'icon' => 'eicon-text-align-left',
1110 ),
1111 'center' => array(
1112 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1113 'icon' => 'eicon-text-align-center',
1114 ),
1115 'flex-end' => array(
1116 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1117 'icon' => 'eicon-text-align-right',
1118 ),
1119 ),
1120 'default' => 'center',
1121 'toggle' => false,
1122 'selectors' => array(
1123 '{{WRAPPER}} .premium-testimonial-author-info' => 'align-items: {{VALUE}}',
1124 ),
1125 )
1126 );
1127
1128 $this->add_control(
1129 'premium_testimonial_company_name_color',
1130 array(
1131 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1132 'type' => Controls_Manager::COLOR,
1133 'global' => array(
1134 'default' => Global_Colors::COLOR_SECONDARY,
1135 ),
1136 'selectors' => array(
1137 '{{WRAPPER}} .premium-testimonial-company-link' => 'color: {{VALUE}};',
1138 ),
1139 )
1140 );
1141
1142 $this->add_group_control(
1143 Group_Control_Typography::get_type(),
1144 array(
1145 'name' => 'company_name_typography',
1146 'selector' => '{{WRAPPER}} .premium-testimonial-company-link',
1147 )
1148 );
1149
1150 $this->add_group_control(
1151 Group_Control_Text_Shadow::get_type(),
1152 array(
1153 'name' => 'company_name_shadow',
1154 'selector' => '{{WRAPPER}} .premium-testimonial-company-link',
1155 )
1156 );
1157
1158 $this->add_responsive_control(
1159 'job_margin',
1160 array(
1161 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1162 'type' => Controls_Manager::DIMENSIONS,
1163 'size_units' => array( 'px', 'em', '%' ),
1164 'selectors' => array(
1165 '{{WRAPPER}} .premium-testimonial-job' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};',
1166 ),
1167 )
1168 );
1169
1170 $this->end_controls_section();
1171
1172 $this->start_controls_section(
1173 'rating_style_section',
1174 array(
1175 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ),
1176 'tab' => Controls_Manager::TAB_STYLE,
1177 )
1178 );
1179
1180 $this->add_control(
1181 'star_size',
1182 array(
1183 'label' => __( 'Star Size', 'premium-addons-for-elementor' ),
1184 'type' => Controls_Manager::NUMBER,
1185 'min' => 1,
1186 'max' => 50,
1187 'default' => 15,
1188 )
1189 );
1190
1191 $this->add_control(
1192 'fill',
1193 array(
1194 'label' => __( 'Star Color', 'premium-addons-for-elementor' ),
1195 'type' => Controls_Manager::COLOR,
1196 'global' => false,
1197 'default' => '#ffab40',
1198 )
1199 );
1200
1201 $this->add_control(
1202 'empty',
1203 array(
1204 'label' => __( 'Empty Star Color', 'premium-addons-for-elementor' ),
1205 'type' => Controls_Manager::COLOR,
1206 'global' => false,
1207 )
1208 );
1209
1210 $this->add_control(
1211 'rating_spacing',
1212 array(
1213 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
1214 'type' => Controls_Manager::SLIDER,
1215 'size_units' => array( 'px', 'em', 'custom' ),
1216 'selectors' => array(
1217 '{{WRAPPER}} .premium-fb-rev-star:not(:last-child)' => 'margin-inline-end: {{SIZE}}{{UNIT}};',
1218 ),
1219 )
1220 );
1221
1222 $this->add_responsive_control(
1223 'rating_margin',
1224 array(
1225 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1226 'type' => Controls_Manager::DIMENSIONS,
1227 'size_units' => array( 'px', 'em', '%' ),
1228 'selectors' => array(
1229 '{{WRAPPER}} .premium-testimonial__rating-wrapper' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};',
1230 ),
1231 )
1232 );
1233
1234 $this->end_controls_section();
1235
1236 $this->start_controls_section(
1237 'content_style_section',
1238 array(
1239 'label' => __( 'Content', 'premium-addons-for-elementor' ),
1240 'tab' => Controls_Manager::TAB_STYLE,
1241 )
1242 );
1243
1244 $this->add_control(
1245 'premium_testimonial_content_color',
1246 array(
1247 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1248 'type' => Controls_Manager::COLOR,
1249 'global' => array(
1250 'default' => Global_Colors::COLOR_TEXT,
1251 ),
1252 'selectors' => array(
1253 '{{WRAPPER}} .premium-testimonial-text-wrapper' => 'color: {{VALUE}};',
1254 ),
1255 )
1256 );
1257
1258 $this->add_group_control(
1259 Group_Control_Typography::get_type(),
1260 array(
1261 'name' => 'content_typography',
1262 'selector' => '{{WRAPPER}} .premium-testimonial-text-wrapper',
1263 )
1264 );
1265
1266 $this->add_responsive_control(
1267 'premium_testimonial_margin',
1268 array(
1269 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1270 'type' => Controls_Manager::DIMENSIONS,
1271 'size_units' => array( 'px', 'em', '%' ),
1272 'selectors' => array(
1273 '{{WRAPPER}} .premium-testimonial-text-wrapper' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};',
1274 ),
1275 )
1276 );
1277
1278 $this->end_controls_section();
1279
1280 $this->start_controls_section(
1281 'quotes_style_section',
1282 array(
1283 'label' => __( 'Quotation Icon', 'premium-addons-for-elementor' ),
1284 'tab' => Controls_Manager::TAB_STYLE,
1285 )
1286 );
1287
1288 $this->add_control(
1289 'premium_testimonial_quote_icon_color',
1290 array(
1291 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1292 'type' => Controls_Manager::COLOR,
1293 'default' => '#58BFCA',
1294 'selectors' => array(
1295 '{{WRAPPER}} .premium-testimonial-quote' => 'fill: {{VALUE}};',
1296 ),
1297 )
1298 );
1299
1300 $this->add_responsive_control(
1301 'premium_testimonial_quotes_size',
1302 array(
1303 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1304 'type' => Controls_Manager::SLIDER,
1305 'size_units' => array( 'px', 'em', '%' ),
1306 'range' => array(
1307 'px' => array(
1308 'min' => 5,
1309 'max' => 250,
1310 ),
1311 ),
1312 'selectors' => array(
1313 '{{WRAPPER}} .premium-testimonial-upper-quote svg, {{WRAPPER}} .premium-testimonial-lower-quote svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
1314 ),
1315 )
1316 );
1317
1318 $this->add_responsive_control(
1319 'premium_testimonial_upper_quote_position',
1320 array(
1321 'label' => __( 'Top Icon Position', 'premium-addons-for-elementor' ),
1322 'type' => Controls_Manager::DIMENSIONS,
1323 'size_units' => array( 'px', 'em', '%' ),
1324 'selectors' => array(
1325 '{{WRAPPER}} .premium-testimonial-upper-quote' => 'top: {{TOP}}{{UNIT}}; left:{{LEFT}}{{UNIT}};',
1326 ),
1327 'condition' => array(
1328 'skin!' => 'skin3',
1329 ),
1330 )
1331 );
1332
1333 $this->add_responsive_control(
1334 'premium_testimonial_lower_quote_position',
1335 array(
1336 'label' => __( 'Bottom Icon Position', 'premium-addons-for-elementor' ),
1337 'type' => Controls_Manager::DIMENSIONS,
1338 'size_units' => array( 'px', 'em', '%' ),
1339 'selectors' => array(
1340 '{{WRAPPER}} .premium-testimonial-lower-quote' => 'right: {{RIGHT}}{{UNIT}}; bottom: {{BOTTOM}}{{UNIT}};',
1341 ),
1342 'condition' => array(
1343 'skin!' => array( 'skin2', 'skin4' ),
1344 ),
1345 )
1346 );
1347
1348 $this->end_controls_section();
1349
1350 $this->start_controls_section(
1351 'carousel_style_section',
1352 array(
1353 'label' => __( 'Carousel Arrows', 'premium-addons-for-elementor' ),
1354 'tab' => Controls_Manager::TAB_STYLE,
1355 'conditions' => array(
1356 'terms' => array(
1357 array(
1358 'name' => 'multiple',
1359 'value' => 'yes',
1360 ),
1361 array(
1362 'relation' => 'or',
1363 'terms' => array(
1364 array(
1365 'terms' => array(
1366 array(
1367 'name' => 'skin',
1368 'operator' => '!==',
1369 'value' => 'skin4',
1370 ),
1371 array(
1372 'name' => 'carousel',
1373 'operator' => '===',
1374 'value' => 'yes',
1375 ),
1376 ),
1377 ),
1378 array(
1379 'terms' => array(
1380 array(
1381 'name' => 'skin',
1382 'operator' => '===',
1383 'value' => 'skin4',
1384 ),
1385 ),
1386 ),
1387
1388 ),
1389 ),
1390 ),
1391 ),
1392 )
1393 );
1394
1395 $this->add_responsive_control(
1396 'carousel_arrows_pos',
1397 array(
1398 'label' => __( 'Horizontal Position', 'premium-addons-for-elementor' ),
1399 'type' => Controls_Manager::SLIDER,
1400 'size_units' => array( 'px', 'em' ),
1401 'range' => array(
1402 'px' => array(
1403 'min' => -100,
1404 'max' => 100,
1405 ),
1406 'em' => array(
1407 'min' => -10,
1408 'max' => 10,
1409 ),
1410 ),
1411 'conditions' => array(
1412 'terms' => array(
1413 array(
1414 'name' => 'multiple',
1415 'value' => 'yes',
1416 ),
1417 array(
1418 'relation' => 'or',
1419 'terms' => array(
1420 array(
1421 'terms' => array(
1422 array(
1423 'name' => 'skin',
1424 'operator' => '!==',
1425 'value' => 'skin4',
1426 ),
1427 array(
1428 'name' => 'carousel',
1429 'operator' => '===',
1430 'value' => 'yes',
1431 ),
1432 ),
1433 ),
1434 array(
1435 'terms' => array(
1436 array(
1437 'name' => 'skin',
1438 'operator' => '===',
1439 'value' => 'skin4',
1440 ),
1441 ),
1442 ),
1443
1444 ),
1445 ),
1446 ),
1447 ),
1448 'selectors' => array(
1449 '{{WRAPPER}} .premium-testimonial-box a.carousel-arrow.carousel-next' => 'right: {{SIZE}}{{UNIT}};',
1450 '{{WRAPPER}} .premium-testimonial-box a.carousel-arrow.carousel-prev' => 'left: {{SIZE}}{{UNIT}};',
1451 ),
1452 )
1453 );
1454
1455 $this->add_responsive_control(
1456 'carousel_arrows_vpos',
1457 array(
1458 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ),
1459 'type' => Controls_Manager::SLIDER,
1460 'size_units' => array( 'px', 'em', '%' ),
1461 'range' => array(
1462 'px' => array(
1463 'min' => 0,
1464 'max' => 600,
1465 ),
1466 'em' => array(
1467 'min' => 0,
1468 'max' => 20,
1469 ),
1470 ),
1471 'conditions' => array(
1472 'terms' => array(
1473 array(
1474 'name' => 'multiple',
1475 'value' => 'yes',
1476 ),
1477 array(
1478 'relation' => 'or',
1479 'terms' => array(
1480 array(
1481 'terms' => array(
1482 array(
1483 'name' => 'skin',
1484 'operator' => '!==',
1485 'value' => 'skin4',
1486 ),
1487 array(
1488 'name' => 'carousel',
1489 'operator' => '===',
1490 'value' => 'yes',
1491 ),
1492 ),
1493 ),
1494 array(
1495 'terms' => array(
1496 array(
1497 'name' => 'skin',
1498 'operator' => '===',
1499 'value' => 'skin4',
1500 ),
1501 ),
1502 ),
1503
1504 ),
1505 ),
1506 ),
1507 ),
1508 'selectors' => array(
1509 '{{WRAPPER}} .premium-testimonial-box a.carousel-arrow' => 'top: {{SIZE}}{{UNIT}};',
1510 ),
1511 )
1512 );
1513
1514 $this->add_control(
1515 'arrow_color',
1516 array(
1517 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1518 'type' => Controls_Manager::COLOR,
1519 'global' => array(
1520 'default' => Global_Colors::COLOR_PRIMARY,
1521 ),
1522 'selectors' => array(
1523 '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'color: {{VALUE}};',
1524 ),
1525 )
1526 );
1527
1528 $this->add_control(
1529 'arrow_hover_color',
1530 array(
1531 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
1532 'type' => Controls_Manager::COLOR,
1533 'global' => array(
1534 'default' => Global_Colors::COLOR_PRIMARY,
1535 ),
1536 'selectors' => array(
1537 '{{WRAPPER}} .premium-testimonial-box .slick-arrow:hover' => 'color: {{VALUE}};',
1538 ),
1539 )
1540 );
1541
1542 $this->add_responsive_control(
1543 'arrow_size',
1544 array(
1545 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1546 'type' => Controls_Manager::SLIDER,
1547 'size_units' => array( 'px', '%', 'em' ),
1548 'selectors' => array(
1549 '{{WRAPPER}} .premium-testimonial-box .slick-arrow i' => 'font-size: {{SIZE}}{{UNIT}};',
1550 ),
1551 )
1552 );
1553
1554 $this->add_control(
1555 'arrow_background',
1556 array(
1557 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1558 'type' => Controls_Manager::COLOR,
1559 'global' => array(
1560 'default' => Global_Colors::COLOR_SECONDARY,
1561 ),
1562 'selectors' => array(
1563 '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'background-color: {{VALUE}};',
1564 ),
1565 )
1566 );
1567
1568 $this->add_control(
1569 'arrow_hover_background',
1570 array(
1571 'label' => __( 'Background Hover Color', 'premium-addons-for-elementor' ),
1572 'type' => Controls_Manager::COLOR,
1573 'global' => array(
1574 'default' => Global_Colors::COLOR_SECONDARY,
1575 ),
1576 'selectors' => array(
1577 '{{WRAPPER}} .premium-testimonial-box .slick-arrow:hover' => 'background-color: {{VALUE}};',
1578 ),
1579 )
1580 );
1581
1582 $this->add_control(
1583 'arrows_lq_effect',
1584 array(
1585 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
1586 'type' => Controls_Manager::SELECT,
1587 'description' => sprintf(
1588 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
1589 esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ),
1590 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
1591 '</a>'
1592 ),
1593 'options' => array(
1594 'none' => __( 'None', 'premium-addons-for-elementor' ),
1595 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
1596 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
1597 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
1598 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
1599 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
1600 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
1601 ),
1602 'frontend_available' => true,
1603 'default' => 'none',
1604 'label_block' => true,
1605 )
1606 );
1607
1608 $this->add_control(
1609 'arrow_border_radius',
1610 array(
1611 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1612 'type' => Controls_Manager::SLIDER,
1613 'size_units' => array( 'px', '%', 'em' ),
1614 'selectors' => array(
1615 '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'border-radius: {{SIZE}}{{UNIT}};',
1616 ),
1617 )
1618 );
1619
1620 $this->add_control(
1621 'arrow_padding',
1622 array(
1623 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1624 'type' => Controls_Manager::SLIDER,
1625 'size_units' => array( 'px', '%', 'em' ),
1626 'selectors' => array(
1627 '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'padding: {{SIZE}}{{UNIT}};',
1628 ),
1629 )
1630 );
1631
1632 $this->end_controls_section();
1633
1634 $this->start_controls_section(
1635 'container_style_section',
1636 array(
1637 'label' => __( 'Container', 'premium-addons-for-elementor' ),
1638 'tab' => Controls_Manager::TAB_STYLE,
1639 )
1640 );
1641
1642 $this->add_responsive_control(
1643 'content_align',
1644 array(
1645 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
1646 'type' => Controls_Manager::CHOOSE,
1647 'options' => array(
1648 'left' => array(
1649 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1650 'icon' => 'eicon-text-align-left',
1651 ),
1652 'center' => array(
1653 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1654 'icon' => 'eicon-text-align-center',
1655 ),
1656 'right' => array(
1657 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1658 'icon' => 'eicon-text-align-right',
1659 ),
1660 ),
1661 'selectors_dictionary' => array(
1662 'left' => 'align-items: flex-start; justify-content: flex-start; text-align: left',
1663 'center' => 'align-items: center; justify-content: flex-start; text-align: center',
1664 'right' => 'align-items: flex-end; justify-content: flex-start; text-align: right',
1665 ),
1666 'default' => 'center',
1667 'selectors' => array(
1668 '{{WRAPPER}} .premium-testimonial-content-wrapper' => '{{VALUE}}',
1669 ),
1670 )
1671 );
1672
1673 $this->add_group_control(
1674 Premium_Background::get_type(),
1675 array(
1676 'name' => 'premium_testimonial_background',
1677 'types' => array( 'classic', 'gradient' ),
1678 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper',
1679 )
1680 );
1681
1682 $this->add_group_control(
1683 Group_Control_Border::get_type(),
1684 array(
1685 'name' => 'premium_testimonial_container_border',
1686 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper',
1687 )
1688 );
1689
1690 $this->add_control(
1691 'premium_testimonial_container_border_radius',
1692 array(
1693 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1694 'type' => Controls_Manager::SLIDER,
1695 'size_units' => array( 'px', 'em', '%' ),
1696 'selectors' => array(
1697 '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'border-radius: {{SIZE}}{{UNIT}}',
1698 ),
1699 'condition' => array(
1700 'container_adv_radius!' => 'yes',
1701 ),
1702 )
1703 );
1704
1705 $this->add_control(
1706 'container_adv_radius',
1707 array(
1708 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
1709 'type' => Controls_Manager::SWITCHER,
1710 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>',
1711 )
1712 );
1713
1714 $this->add_control(
1715 'container_adv_radius_value',
1716 array(
1717 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1718 'type' => Controls_Manager::TEXT,
1719 'dynamic' => array( 'active' => true ),
1720 'selectors' => array(
1721 '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'border-radius: {{VALUE}};',
1722 ),
1723 'condition' => array(
1724 'container_adv_radius' => 'yes',
1725 ),
1726 'ai' => array(
1727 'active' => false,
1728 ),
1729 )
1730 );
1731
1732 $this->add_group_control(
1733 Group_Control_Box_Shadow::get_type(),
1734 array(
1735 'name' => 'premium_testimonial_container_box_shadow',
1736 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper',
1737 )
1738 );
1739
1740 $this->add_responsive_control(
1741 'premium_testimonial_box_padding',
1742 array(
1743 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1744 'type' => Controls_Manager::DIMENSIONS,
1745 'size_units' => array( 'px', 'em', '%' ),
1746 'selectors' => array(
1747 '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1748 ),
1749 )
1750 );
1751
1752 $this->end_controls_section();
1753 }
1754
1755 /**
1756 * Render Testimonials widget output on the frontend.
1757 *
1758 * Written in PHP and used to generate the final HTML.
1759 *
1760 * @since 1.0.0
1761 * @access protected
1762 */
1763 protected function render() {
1764
1765 $settings = $this->get_settings_for_display();
1766
1767 $papro_activated = Helper_Functions::check_papro_version();
1768
1769 if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.8', '<' ) ) {
1770
1771 if ( 'skin1' !== $settings['skin'] ) {
1772
1773 ?>
1774 <div class="premium-error-notice">
1775 <?php
1776 $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' );
1777 echo wp_kses_post( $message );
1778 ?>
1779 </div>
1780 <?php
1781 return false;
1782
1783 }
1784 }
1785
1786 $person_title_tag = Helper_Functions::validate_html_tag( $settings['premium_testimonial_person_name_size'] );
1787 $job_tag = Helper_Functions::validate_html_tag( $settings['premium_testimonial_company_name_size'] );
1788
1789 $this->add_render_attribute(
1790 'testimonials_container',
1791 'class',
1792 array(
1793 'premium-testimonial-box',
1794 )
1795 );
1796
1797 $show_image = 'skin4' !== $settings['skin'] ? $settings['show_image'] : 'yes';
1798
1799 if ( 'yes' === $show_image ) {
1800 $this->add_render_attribute( 'img_wrap', 'class', 'premium-testimonial-img-wrapper' );
1801 }
1802
1803 if ( 'yes' !== $settings['multiple'] ) {
1804
1805 $this->add_inline_editing_attributes( 'premium_testimonial_person_name' );
1806 $this->add_inline_editing_attributes( 'premium_testimonial_company_name' );
1807 $this->add_inline_editing_attributes( 'heading' );
1808 $this->add_inline_editing_attributes( 'premium_testimonial_content', 'advanced' );
1809
1810 $image_src = '';
1811 $alt = '';
1812
1813 if ( 'yes' === $show_image ) {
1814
1815 if ( ! empty( $settings['premium_testimonial_person_image']['url'] ) ) {
1816 $image_src = $settings['premium_testimonial_person_image']['url'];
1817 $alt = esc_attr( Control_Media::get_image_alt( $settings['premium_testimonial_person_image'] ) );
1818 }
1819 }
1820
1821 if ( 'yes' === $settings['premium_testimonial_company_link_switcher'] ) {
1822
1823 $this->add_link_attributes( 'link', $settings['premium_testimonial_company_link'] );
1824 $this->add_render_attribute( 'link', 'class', 'premium-testimonial-company-link' );
1825
1826 }
1827 } else {
1828
1829 $testimonials = $settings['multiple_testimonials'];
1830
1831 $this->add_render_attribute( 'testimonials_container', 'class', 'multiple-testimonials' );
1832
1833 }
1834
1835 if ( 'yes' === $settings['multiple'] && 'masonry' === $settings['premium_testimonial_layout'] && 'yes' !== $settings['carousel'] ) {
1836 $this->add_render_attribute( 'testimonials_container', 'class', 'premium-testimonial-masonry' );
1837 }
1838
1839 $carousel = 'yes' === $settings['carousel'] ? true : false;
1840
1841 if ( $carousel ) {
1842
1843 $this->add_render_attribute( 'testimonials_container', 'data-carousel', 'true' );
1844
1845 $this->add_render_attribute(
1846 'testimonials_container',
1847 array(
1848 'data-rtl' => is_rtl(),
1849 )
1850 );
1851
1852 }
1853
1854 ?>
1855
1856 <?php
1857 if ( 'yes' === $settings['multiple'] && 'skin4' === $settings['skin'] ) {
1858
1859 $images_markup = '';
1860
1861 foreach ( $testimonials as $index => $testimonial ) {
1862
1863 $testimonial_image_html = $this->get_author_image( $testimonial );
1864 $images_markup .= '<div class="premium-testimonial__carousel-img premium-testimonial-img-wrapper" data-index="' . $index . '">' . $testimonial_image_html . '</div>';
1865 }
1866
1867 echo '<div class="premium-testimonial__carousel">' . wp_kses_post( $images_markup ) . '</div>';
1868 }
1869 ?>
1870
1871 <div <?php $this->print_render_attribute_string( 'testimonials_container' ); ?>>
1872
1873 <?php if ( 'yes' !== $settings['multiple'] ) : ?>
1874
1875 <div class="premium-testimonial-container">
1876
1877 <?php if ( 'skin3' !== $settings['skin'] ) : ?>
1878 <div class="premium-testimonial-upper-quote">
1879 <?php $this->render_quote_icon(); ?>
1880 </div>
1881 <?php endif; ?>
1882
1883 <div class="premium-testimonial-content-wrapper">
1884
1885 <?php if ( ! empty( $settings['heading'] ) ) : ?>
1886 <div class="premium-testimonial-heading">
1887 <p <?php $this->print_render_attribute_string( 'heading' ); ?>>
1888 <?php echo wp_kses_post( $settings['heading'] ); ?>
1889 </p>
1890 </div>
1891 <?php endif; ?>
1892
1893 <div class="premium-testimonial-text-wrapper">
1894 <div <?php $this->print_render_attribute_string( 'premium_testimonial_content' ); ?>>
1895 <?php echo $this->parse_text_editor( $settings['premium_testimonial_content'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
1896 </div>
1897 </div>
1898
1899 <?php if ( ! empty( $settings['rating'] ) ) : ?>
1900 <div class="premium-testimonial__rating-wrapper">
1901 <?php Helper_Functions::render_rating_stars( $settings['rating'], $settings['fill'], $settings['empty'], $settings['star_size'] ); ?>
1902 </div>
1903 <?php endif; ?>
1904
1905 <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?>
1906 <div class="premium-testimonial__img-info">
1907 <?php endif; ?>
1908
1909
1910 <?php if ( ! empty( $image_src ) ) : ?>
1911 <div <?php $this->print_render_attribute_string( 'img_wrap' ); ?>>
1912 <img src="<?php echo esc_url( $image_src ); ?>" alt="<?php echo esc_attr( $alt ); ?>" class="premium-testimonial-person-image">
1913 </div>
1914 <?php endif; ?>
1915
1916
1917 <div class="premium-testimonial-author-info">
1918 <<?php echo wp_kses_post( $person_title_tag ); ?> class="premium-testimonial-person-name">
1919 <span <?php $this->print_render_attribute_string( 'premium_testimonial_person_name' ); ?>>
1920 <?php echo wp_kses_post( $settings['premium_testimonial_person_name'] ); ?>
1921 </span>
1922 </<?php echo wp_kses_post( $person_title_tag ); ?>>
1923
1924 <?php if ( ! empty( $settings['premium_testimonial_company_name'] ) ) : ?>
1925 <<?php echo wp_kses_post( $job_tag ); ?> class="premium-testimonial-job">
1926 <?php if ( 'yes' === $settings['premium_testimonial_company_link_switcher'] ) : ?>
1927 <a <?php $this->print_render_attribute_string( 'link' ); ?>>
1928 <span <?php $this->print_render_attribute_string( 'premium_testimonial_company_name' ); ?>>
1929 <?php echo wp_kses_post( $settings['premium_testimonial_company_name'] ); ?>
1930 </span>
1931 </a>
1932 <?php else : ?>
1933 <span class="premium-testimonial-company-link" <?php $this->print_render_attribute_string( 'premium_testimonial_company_name' ); ?>>
1934 <?php echo wp_kses_post( $settings['premium_testimonial_company_name'] ); ?>
1935 </span>
1936 <?php endif; ?>
1937 </<?php echo wp_kses_post( $job_tag ); ?>>
1938 <?php endif; ?>
1939 </div>
1940
1941 <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?>
1942 </div>
1943 <?php endif; ?>
1944
1945 </div>
1946
1947 <?php if ( in_array( $settings['skin'], array( 'skin1', 'skin3' ), true ) ) : ?>
1948 <div class="premium-testimonial-lower-quote">
1949 <?php $this->render_quote_icon(); ?>
1950 </div>
1951 <?php endif; ?>
1952 </div>
1953
1954 <?php else : ?>
1955
1956 <?php if ( 'skin4' === $settings['skin'] ) : ?>
1957 <div class="premium-testimonial-upper-quote">
1958 <?php $this->render_quote_icon(); ?>
1959 </div>
1960 <?php endif; ?>
1961
1962 <?php
1963 foreach ( $testimonials as $index => $testimonial ) :
1964
1965 if ( 'yes' === $show_image ) {
1966 $testimonial_image_html = $this->get_author_image( $testimonial );
1967 }
1968
1969 if ( 'yes' === $testimonial['link_switcher'] ) {
1970
1971 $this->add_render_attribute( 'link_' . $index, 'class', 'premium-testimonial-company-link' );
1972 $this->add_link_attributes( 'link_' . $index, $testimonial['link'] );
1973 }
1974
1975 ?>
1976
1977 <div class="premium-testimonial-container">
1978
1979 <?php if ( ! in_array( $settings['skin'], array( 'skin3', 'skin4' ), true ) ) : ?>
1980 <div class="premium-testimonial-upper-quote">
1981 <?php $this->render_quote_icon(); ?>
1982 </div>
1983 <?php endif; ?>
1984
1985 <div class="premium-testimonial-content-wrapper">
1986
1987 <?php if ( ! empty( $testimonial['heading'] ) ) : ?>
1988 <div class="premium-testimonial-heading">
1989 <p <?php $this->print_render_attribute_string( 'heading' ); ?>>
1990 <?php echo wp_kses_post( $testimonial['heading'] ); ?>
1991 </p>
1992 </div>
1993 <?php endif; ?>
1994
1995 <div class="premium-testimonial-text-wrapper">
1996 <div <?php $this->print_render_attribute_string( 'premium_testimonial_content' ); ?>>
1997 <?php echo $this->parse_text_editor( $testimonial['content'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
1998 </div>
1999 </div>
2000
2001 <?php if ( ! empty( $testimonial['rating'] ) ) : ?>
2002 <div class="premium-testimonial__rating-wrapper">
2003 <?php Helper_Functions::render_rating_stars( $testimonial['rating'], $settings['fill'], $settings['empty'], $settings['star_size'] ); ?>
2004 </div>
2005 <?php endif; ?>
2006
2007 <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?>
2008 <div class="premium-testimonial__img-info">
2009 <?php endif; ?>
2010
2011 <?php if ( 'skin4' !== $settings['skin'] ) : ?>
2012 <?php if ( ! empty( $testimonial_image_html ) ) : ?>
2013 <div <?php $this->print_render_attribute_string( 'img_wrap' ); ?>>
2014 <?php echo wp_kses_post( $testimonial_image_html ); ?>
2015 </div>
2016 <?php endif; ?>
2017 <?php endif; ?>
2018
2019 <div class="premium-testimonial-author-info">
2020 <<?php echo wp_kses_post( $person_title_tag ); ?> class="premium-testimonial-person-name">
2021 <span <?php $this->print_render_attribute_string( 'premium_testimonial_person_name' ); ?>>
2022 <?php echo wp_kses_post( $testimonial['person_name'] ); ?>
2023 </span>
2024 </<?php echo wp_kses_post( $person_title_tag ); ?>>
2025
2026 <?php if ( ! empty( $testimonial['company_name'] ) ) : ?>
2027 <<?php echo wp_kses_post( $job_tag ); ?> class="premium-testimonial-job">
2028 <?php if ( 'yes' === $testimonial['link_switcher'] ) : ?>
2029 <a <?php $this->print_render_attribute_string( 'link_' . $index ); ?>>
2030 <span <?php $this->print_render_attribute_string( 'premium_testimonial_company_name' ); ?>>
2031 <?php echo wp_kses_post( $testimonial['company_name'] ); ?>
2032 </span>
2033 </a>
2034 <?php else : ?>
2035 <span class="premium-testimonial-company-link" <?php $this->print_render_attribute_string( 'premium_testimonial_company_name' ); ?>>
2036 <?php echo wp_kses_post( $testimonial['company_name'] ); ?>
2037 </span>
2038 <?php endif; ?>
2039 </<?php echo wp_kses_post( $job_tag ); ?>>
2040 <?php endif; ?>
2041 </div>
2042
2043 <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?>
2044 </div>
2045 <?php endif; ?>
2046
2047 </div>
2048
2049 <?php if ( in_array( $settings['skin'], array( 'skin1', 'skin3' ), true ) ) : ?>
2050 <div class="premium-testimonial-lower-quote">
2051 <?php $this->render_quote_icon(); ?>
2052 </div>
2053 <?php endif; ?>
2054 </div>
2055
2056 <?php endforeach; ?>
2057 <?php
2058 endif;
2059
2060 if ( Plugin::instance()->editor->is_edit_mode() ) {
2061
2062 if ( 'yes' === $settings['multiple'] ) {
2063 if ( 'masonry' === $settings['premium_testimonial_layout'] && 'yes' !== $settings['carousel'] ) {
2064 $this->render_editor_script();
2065 }
2066 }
2067 }
2068 ?>
2069 </div>
2070 <?php
2071 }
2072
2073 /**
2074 * Render Quote Icon
2075 *
2076 * @since 4.10.13
2077 * @access protected
2078 */
2079 protected function render_quote_icon() {
2080
2081 $settings = $this->get_settings_for_display();
2082
2083 if ( 'rounded' === $settings['icon_style'] ) {
2084
2085 $svg_html = '<svg class="premium-testimonial-quote" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="48" height="37" viewBox="0 0 48 37"><path d="m37,37c6.07,0,11-4.93,11-11s-4.93-11-11-11c-.32,0-.63.02-.94.05.54-4.81,2.18-9.43,4.79-13.52.19-.31.2-.7.03-1.01-.18-.32-.51-.52-.88-.52h-2c-.27,0-.54.11-.73.31-5.14,5.41-11.27,14.26-11.27,25.69,0,6.07,4.93,10.99,11,11h0Zm-26,0c6.07,0,11-4.93,11-11s-4.93-11-11-11c-.32,0-.63.02-.94.05.54-4.81,2.18-9.43,4.79-13.52.19-.31.2-.7.03-1.01-.18-.32-.51-.52-.87-.52h-2c-.27,0-.54.11-.73.31C6.13,5.72,0,14.57,0,26c0,6.07,4.93,10.99,11,11h0Zm0,0"/></svg>';
2086
2087 } else {
2088
2089 $svg_html = '<svg class="premium-testimonial-quote" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="48" height="37.5" viewBox="0 0 48 37.5"><path d="m21,16.5v21H0v-21.3C0,1.8,13.5,0,13.5,0l1.8,4.2s-6,.9-7.2,5.7c-1.2,3.6,1.2,6.6,1.2,6.6h11.7Zm27,0v21h-21v-21.3C27,1.8,40.5,0,40.5,0l1.8,4.2s-6,.9-7.2,5.7c-1.2,3.6,1.2,6.6,1.2,6.6h11.7Z"/></svg>';
2090 }
2091
2092 echo $svg_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2093 }
2094
2095 /**
2096 * Get Author Image
2097 *
2098 * @since 4.10.13
2099 * @access protected
2100 */
2101 protected function get_author_image( $testimonial ) {
2102
2103 $testimonial_image_html = '';
2104 if ( ! empty( $testimonial['person_image']['url'] ) ) {
2105
2106 $image_src = $testimonial['person_image']['url'];
2107 $image_id = attachment_url_to_postid( $image_src ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.attachment_url_to_postid_attachment_url_to_postid -- Core fn; wpcom_vip_attachment_url_to_postid() only exists on WP VIP.
2108
2109 $settings['image_data'] = Helper_Functions::get_image_data( $image_id, $testimonial['person_image']['url'], 'thumbnail' );
2110 $testimonial_image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image_data' );
2111
2112 }
2113
2114 return $testimonial_image_html;
2115 }
2116
2117 /**
2118 * Render Editor Masonry Script.
2119 *
2120 * @since 4.10.13
2121 * @access protected
2122 */
2123 protected function render_editor_script() {
2124
2125 ?>
2126 <script type="text/javascript">
2127 jQuery( document ).ready( function( $ ) {
2128
2129 $( '.premium-testimonial-box' ).each( function() {
2130
2131 var $node_id = '<?php echo esc_attr( $this->get_id() ); ?>',
2132 scope = $( '[data-id="' + $node_id + '"]' ),
2133 selector = $(this);
2134
2135 if ( selector.closest( scope ).length < 1 ) {
2136 return;
2137 }
2138
2139 var masonryArgs = {
2140 itemSelector : '.premium-testimonial-container',
2141 percentPosition : true,
2142 layoutMode : 'masonry',
2143 };
2144
2145 var $isotopeObj = {};
2146
2147 selector.imagesLoaded( function() {
2148
2149 $isotopeObj = selector.isotope( masonryArgs );
2150
2151 $isotopeObj.imagesLoaded().progress(function() {
2152 $isotopeObj.isotope("layout");
2153 });
2154
2155 selector.find('.premium-testimonial-container').resize( function() {
2156 $isotopeObj.isotope( 'layout' );
2157 });
2158 });
2159
2160 if ( window.elementor ) {
2161 //No need to limit the change to the spacing control only, as changing the container size for example will affect the masonry layout.
2162 var debounceDelay;
2163 elementor.channels.editor.on('change', function(e) {
2164
2165 clearTimeout(debounceDelay);
2166
2167 debounceDelay = setTimeout(function() {
2168 $isotopeObj.isotope('layout');
2169 }, 300);
2170 });
2171 }
2172 });
2173 });
2174 </script>
2175 <?php
2176 }
2177 }
2178