PluginProbe
Elementor Website Builder – more than just a page builder / 3.27.4
Elementor Website Builder – more than just a page builder v3.27.4
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | includes/widgets/testimonial.php +31 -51 4.0.93.27.4 View file →
@@ -96,29 +96,8 @@
96 96 return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
97 97 }
98 98
99 99 /**
100 - * Get widget upsale data.
101 - *
102 - * Retrieve the widget promotion data.
103 - *
104 - * @since 3.18.0
105 - * @access protected
106 - *
107 - * @return array Widget promotion data.
108 - */
109 - protected function get_upsale_data() {
110 - return [
111 - 'condition' => ! Utils::has_pro(),
112 - 'image' => esc_url( ELEMENTOR_ASSETS_URL . 'images/go-pro.svg' ),
113 - 'image_alt' => esc_attr__( 'Upgrade', 'elementor' ),
114 - 'description' => esc_html__( 'Use interesting masonry layouts and other overlay features with Elementor\'s Pro Gallery widget.', 'elementor' ),
115 - 'upgrade_url' => esc_url( 'https://go.elementor.com/go-pro-testimonial-widget/' ),
116 - 'upgrade_text' => esc_html__( 'Upgrade Now', 'elementor' ),
117 - ];
118 - }
119 -
120 - /**
121 100 * Register testimonial widget controls.
122 101 *
123 102 * Adds different input fields to allow the user to change and customize the widget settings.
124 103 *
@@ -208,8 +187,10 @@
208 187 ],
209 188 ]
210 189 );
211 190
191 + $aside = is_rtl() ? 'right' : 'left';
192 +
212 193 $this->add_control(
213 194 'testimonial_image_position',
214 195 [
215 196 'label' => esc_html__( 'Image Position', 'elementor' ),
@@ -217,9 +198,9 @@
217 198 'default' => 'aside',
218 199 'options' => [
219 200 'aside' => [
220 201 'title' => esc_html__( 'Aside', 'elementor' ),
221 - 'icon' => 'eicon-h-align-left',
202 + 'icon' => 'eicon-h-align-' . $aside,
222 203 ],
223 204 'top' => [
224 205 'title' => esc_html__( 'Top', 'elementor' ),
225 206 'icon' => 'eicon-v-align-top',
@@ -229,9 +210,8 @@
229 210 'condition' => [
230 211 'testimonial_image[url]!' => '',
231 212 ],
232 213 'separator' => 'before',
233 - 'classes' => 'elementor-control-start-end',
234 214 'style_transfer' => true,
235 215 ]
236 216 );
237 217
@@ -241,10 +221,10 @@
241 221 'label' => esc_html__( 'Alignment', 'elementor' ),
242 222 'type' => Controls_Manager::CHOOSE,
243 223 'default' => 'center',
244 224 'options' => [
245 - 'start' => [
246 - 'title' => esc_html__( 'Start', 'elementor' ),
225 + 'left' => [
226 + 'title' => esc_html__( 'Left', 'elementor' ),
247 227 'icon' => 'eicon-text-align-left',
248 228 ],
249 229 'center' => [
250 230 'title' => esc_html__( 'Center', 'elementor' ),
@@ -249,18 +229,13 @@
249 229 'center' => [
250 230 'title' => esc_html__( 'Center', 'elementor' ),
251 231 'icon' => 'eicon-text-align-center',
252 232 ],
253 - 'end' => [
254 - 'title' => esc_html__( 'End', 'elementor' ),
233 + 'right' => [
234 + 'title' => esc_html__( 'Right', 'elementor' ),
255 235 'icon' => 'eicon-text-align-right',
256 236 ],
257 237 ],
258 - 'classes' => 'elementor-control-start-end',
259 - 'selectors_dictionary' => [
260 - 'left' => is_rtl() ? 'end' : 'start',
261 - 'right' => is_rtl() ? 'start' : 'end',
262 - ],
263 238 'selectors' => [
264 239 '{{WRAPPER}} .elementor-testimonial-wrapper' => 'text-align: {{VALUE}}',
265 240 ],
266 241 'style_transfer' => true,
@@ -266,8 +241,18 @@
266 241 'style_transfer' => true,
267 242 ]
268 243 );
269 244
245 + if ( ! Utils::has_pro() ) {
246 + $this->add_control(
247 + Utils::TESTIMONIAL_WIDGET . '_promotion',
248 + [
249 + 'label' => esc_html__( 'Loop Carousel widget', 'elementor' ),
250 + 'type' => Promotion_Control::TYPE,
251 + ]
252 + );
253 + }
254 +
270 255 $this->end_controls_section();
271 256
272 257 // Content.
273 258 $this->start_controls_section(
@@ -499,9 +484,9 @@
499 484 if ( $has_content ) :
500 485 $this->add_render_attribute( 'testimonial_content', 'class', 'elementor-testimonial-content' );
501 486 $this->add_inline_editing_attributes( 'testimonial_content' );
502 487 ?>
503 - <div <?php $this->print_render_attribute_string( 'testimonial_content' ); ?>><?php echo wp_kses_post( $settings['testimonial_content'] ); ?></div>
488 + <div <?php $this->print_render_attribute_string( 'testimonial_content' ); ?>><?php $this->print_unescaped_setting( 'testimonial_content' ); ?></div>
504 489 <?php endif; ?>
505 490
506 491 <?php if ( $has_image || $has_name || $has_job ) : ?>
507 492 <div <?php $this->print_render_attribute_string( 'meta' ); ?>>
@@ -526,13 +511,13 @@
526 511 $this->add_inline_editing_attributes( 'testimonial_name', 'none' );
527 512
528 513 if ( ! empty( $settings['link']['url'] ) ) :
529 514 ?>
530 - <a <?php $this->print_render_attribute_string( 'testimonial_name' ); ?> <?php $this->print_render_attribute_string( 'link' ); ?>><?php echo wp_kses_post( $settings['testimonial_name'] ); ?></a>
515 + <a <?php $this->print_render_attribute_string( 'testimonial_name' ); ?> <?php $this->print_render_attribute_string( 'link' ); ?>><?php $this->print_unescaped_setting( 'testimonial_name' ); ?></a>
531 516 <?php
532 517 else :
533 518 ?>
534 - <div <?php $this->print_render_attribute_string( 'testimonial_name' ); ?>><?php echo wp_kses_post( $settings['testimonial_name'] ); ?></div>
519 + <div <?php $this->print_render_attribute_string( 'testimonial_name' ); ?>><?php $this->print_unescaped_setting( 'testimonial_name' ); ?></div>
535 520 <?php
536 521 endif;
537 522 endif; ?>
538 523 <?php
@@ -542,13 +527,13 @@
542 527 $this->add_inline_editing_attributes( 'testimonial_job', 'none' );
543 528
544 529 if ( ! empty( $settings['link']['url'] ) ) :
545 530 ?>
546 - <a <?php $this->print_render_attribute_string( 'testimonial_job' ); ?> <?php $this->print_render_attribute_string( 'link' ); ?>><?php echo wp_kses_post( $settings['testimonial_job'] ); ?></a>
531 + <a <?php $this->print_render_attribute_string( 'testimonial_job' ); ?> <?php $this->print_render_attribute_string( 'link' ); ?>><?php $this->print_unescaped_setting( 'testimonial_job' ); ?></a>
547 532 <?php
548 533 else :
549 534 ?>
550 - <div <?php $this->print_render_attribute_string( 'testimonial_job' ); ?>><?php echo wp_kses_post( $settings['testimonial_job'] ); ?></div>
535 + <div <?php $this->print_render_attribute_string( 'testimonial_job' ); ?>><?php $this->print_unescaped_setting( 'testimonial_job' ); ?></div>
551 536 <?php
552 537 endif;
553 538 endif; ?>
554 539 </div>
@@ -588,10 +573,10 @@
588 573 imageUrl = elementor.imagesManager.getImageUrl( image );
589 574 hasImage = ' elementor-has-image';
590 575
591 576 var imageHtml = '<img src="' + _.escape( imageUrl ) + '" alt="testimonial" />';
592 - if ( settings.link?.url ) {
593 - imageHtml = '<a href="' + elementor.helpers.sanitizeUrl( settings.link?.url ) + '">' + imageHtml + '</a>';
577 + if ( settings.link.url ) {
578 + imageHtml = '<a href="' + elementor.helpers.sanitizeUrl( settings.link.url ) + '">' + imageHtml + '</a>';
594 579 }
595 580 }
596 581
597 582 var testimonial_image_position = settings.testimonial_image_position ? ' elementor-testimonial-image-position-' + settings.testimonial_image_position : '';
@@ -600,19 +585,14 @@
600 585 <# if ( '' !== settings.testimonial_content ) {
601 586 view.addRenderAttribute( 'testimonial_content', {
602 587 'data-binding-type': 'content',
603 588 'data-binding-setting': 'testimonial_content',
604 - 'data-binding-config': JSON.stringify({
605 - 'testimonial_content': {
606 - editType: "text"
607 - }
608 - })
609 589 } );
610 590 view.addRenderAttribute( 'testimonial_content', 'class', 'elementor-testimonial-content' );
611 591
612 592 view.addInlineEditingAttributes( 'testimonial_content' );
613 593 #>
614 - <div {{{ view.getRenderAttributeString( 'testimonial_content' ) }}}>{{ settings.testimonial_content }}</div>
594 + <div {{{ view.getRenderAttributeString( 'testimonial_content' ) }}}>{{{ settings.testimonial_content }}}</div>
615 595 <# } #>
616 596 <div class="elementor-testimonial-meta{{ hasImage }}{{ testimonial_image_position }}">
617 597 <div class="elementor-testimonial-meta-inner">
618 598 <# if ( imageUrl ) { #>
@@ -634,15 +614,15 @@
634 614 view.addRenderAttribute( 'testimonial_name', 'class', 'elementor-testimonial-name' );
635 615
636 616 view.addInlineEditingAttributes( 'testimonial_name', 'none' );
637 617
638 - if ( settings.link?.url ) {
618 + if ( settings.link.url ) {
639 619 #>
640 - <a href="{{ elementor.helpers.sanitizeUrl( settings.link?.url ) }}" {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{ settings.testimonial_name }}</a>
620 + <a href="{{ elementor.helpers.sanitizeUrl( settings.link.url ) }}" {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{{ settings.testimonial_name }}}</a>
641 621 <#
642 622 } else {
643 623 #>
644 - <div {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{ settings.testimonial_name }}</div>
624 + <div {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{{ settings.testimonial_name }}}</div>
645 625 <#
646 626 }
647 627 }
648 628
@@ -650,15 +630,15 @@
650 630 view.addRenderAttribute( 'testimonial_job', 'class', 'elementor-testimonial-job' );
651 631
652 632 view.addInlineEditingAttributes( 'testimonial_job', 'none' );
653 633
654 - if ( settings.link?.url ) {
634 + if ( settings.link.url ) {
655 635 #>
656 - <a href="{{ elementor.helpers.sanitizeUrl( settings.link?.url ) }}" {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{ settings.testimonial_job }}</a>
636 + <a href="{{ elementor.helpers.sanitizeUrl( settings.link.url ) }}" {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{{ settings.testimonial_job }}}</a>
657 637 <#
658 638 } else {
659 639 #>
660 - <div {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{ settings.testimonial_job }}</div>
640 + <div {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{{ settings.testimonial_job }}}</div>
661 641 <#
662 642 }
663 643 }
664 644 #>