PluginProbe
Elementor Website Builder – more than just a page builder / 3.23.0-dev3
Elementor Website Builder – more than just a page builder v3.23.0-dev3
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 +21 -75 4.2.13.23.0-dev3 View file →
@@ -6,9 +6,8 @@
6 6 }
7 7
8 8 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
9 9 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
10 -use Elementor\Modules\Promotions\Controls\Promotion_Control;
11 10
12 11 /**
13 12 * Elementor testimonial widget.
14 13 *
@@ -78,26 +77,8 @@
78 77 return false;
79 78 }
80 79
81 80 /**
82 - * Get style dependencies.
83 - *
84 - * Retrieve the list of style dependencies the widget requires.
85 - *
86 - * @since 3.24.0
87 - * @access public
88 - *
89 - * @return array Widget style dependencies.
90 - */
91 - public function get_style_depends(): array {
92 - return [ 'widget-testimonial' ];
93 - }
94 -
95 - public function has_widget_inner_wrapper(): bool {
96 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
97 - }
98 -
99 - /**
100 81 * Get widget upsale data.
101 82 *
102 83 * Retrieve the widget promotion data.
103 84 *
@@ -208,8 +189,10 @@
208 189 ],
209 190 ]
210 191 );
211 192
193 + $aside = is_rtl() ? 'right' : 'left';
194 +
212 195 $this->add_control(
213 196 'testimonial_image_position',
214 197 [
215 198 'label' => esc_html__( 'Image Position', 'elementor' ),
@@ -217,9 +200,9 @@
217 200 'default' => 'aside',
218 201 'options' => [
219 202 'aside' => [
220 203 'title' => esc_html__( 'Aside', 'elementor' ),
221 - 'icon' => 'eicon-h-align-left',
204 + 'icon' => 'eicon-h-align-' . $aside,
222 205 ],
223 206 'top' => [
224 207 'title' => esc_html__( 'Top', 'elementor' ),
225 208 'icon' => 'eicon-v-align-top',
@@ -229,9 +212,8 @@
229 212 'condition' => [
230 213 'testimonial_image[url]!' => '',
231 214 ],
232 215 'separator' => 'before',
233 - 'classes' => 'elementor-control-start-end',
234 216 'style_transfer' => true,
235 217 ]
236 218 );
237 219
@@ -241,10 +223,10 @@
241 223 'label' => esc_html__( 'Alignment', 'elementor' ),
242 224 'type' => Controls_Manager::CHOOSE,
243 225 'default' => 'center',
244 226 'options' => [
245 - 'start' => [
246 - 'title' => esc_html__( 'Start', 'elementor' ),
227 + 'left' => [
228 + 'title' => esc_html__( 'Left', 'elementor' ),
247 229 'icon' => 'eicon-text-align-left',
248 230 ],
249 231 'center' => [
250 232 'title' => esc_html__( 'Center', 'elementor' ),
@@ -249,18 +231,13 @@
249 231 'center' => [
250 232 'title' => esc_html__( 'Center', 'elementor' ),
251 233 'icon' => 'eicon-text-align-center',
252 234 ],
253 - 'end' => [
254 - 'title' => esc_html__( 'End', 'elementor' ),
235 + 'right' => [
236 + 'title' => esc_html__( 'Right', 'elementor' ),
255 237 'icon' => 'eicon-text-align-right',
256 238 ],
257 239 ],
258 - 'classes' => 'elementor-control-start-end',
259 - 'selectors_dictionary' => [
260 - 'left' => is_rtl() ? 'end' : 'start',
261 - 'right' => is_rtl() ? 'start' : 'end',
262 - ],
263 240 'selectors' => [
264 241 '{{WRAPPER}} .elementor-testimonial-wrapper' => 'text-align: {{VALUE}}',
265 242 ],
266 243 'style_transfer' => true,
@@ -499,9 +476,9 @@
499 476 if ( $has_content ) :
500 477 $this->add_render_attribute( 'testimonial_content', 'class', 'elementor-testimonial-content' );
501 478 $this->add_inline_editing_attributes( 'testimonial_content' );
502 479 ?>
503 - <div <?php $this->print_render_attribute_string( 'testimonial_content' ); ?>><?php echo wp_kses_post( $settings['testimonial_content'] ); ?></div>
480 + <div <?php $this->print_render_attribute_string( 'testimonial_content' ); ?>><?php $this->print_unescaped_setting( 'testimonial_content' ); ?></div>
504 481 <?php endif; ?>
505 482
506 483 <?php if ( $has_image || $has_name || $has_job ) : ?>
507 484 <div <?php $this->print_render_attribute_string( 'meta' ); ?>>
@@ -526,13 +503,13 @@
526 503 $this->add_inline_editing_attributes( 'testimonial_name', 'none' );
527 504
528 505 if ( ! empty( $settings['link']['url'] ) ) :
529 506 ?>
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>
507 + <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 508 <?php
532 509 else :
533 510 ?>
534 - <div <?php $this->print_render_attribute_string( 'testimonial_name' ); ?>><?php echo wp_kses_post( $settings['testimonial_name'] ); ?></div>
511 + <div <?php $this->print_render_attribute_string( 'testimonial_name' ); ?>><?php $this->print_unescaped_setting( 'testimonial_name' ); ?></div>
535 512 <?php
536 513 endif;
537 514 endif; ?>
538 515 <?php
@@ -542,13 +519,13 @@
542 519 $this->add_inline_editing_attributes( 'testimonial_job', 'none' );
543 520
544 521 if ( ! empty( $settings['link']['url'] ) ) :
545 522 ?>
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>
523 + <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 524 <?php
548 525 else :
549 526 ?>
550 - <div <?php $this->print_render_attribute_string( 'testimonial_job' ); ?>><?php echo wp_kses_post( $settings['testimonial_job'] ); ?></div>
527 + <div <?php $this->print_render_attribute_string( 'testimonial_job' ); ?>><?php $this->print_unescaped_setting( 'testimonial_job' ); ?></div>
551 528 <?php
552 529 endif;
553 530 endif; ?>
554 531 </div>
@@ -567,34 +544,8 @@
567 544 *
568 545 * @since 2.9.0
569 546 * @access protected
570 547 */
571 - public function render_markdown(): string {
572 - $settings = $this->get_settings_for_display();
573 -
574 - $content = Utils::html_to_plain_text( $settings['testimonial_content'] ?? '' );
575 - $name = Utils::html_to_plain_text( $settings['testimonial_name'] ?? '' );
576 - $job = Utils::html_to_plain_text( $settings['testimonial_job'] ?? '' );
577 -
578 - if ( empty( $content ) && empty( $name ) ) {
579 - return '';
580 - }
581 -
582 - $md = '';
583 -
584 - if ( ! empty( $content ) ) {
585 - $md = '> "' . $content . '"';
586 - }
587 -
588 - $attribution = array_filter( [ $name, $job ] );
589 -
590 - if ( ! empty( $attribution ) ) {
591 - $md .= "\n>\n> -- " . implode( ', ', $attribution );
592 - }
593 -
594 - return $md;
595 - }
596 -
597 548 protected function content_template() {
598 549 ?>
599 550 <#
600 551 if ( '' === settings.testimonial_content && '' === settings.testimonial_image.url && '' === settings.testimonial_name && '' === settings.testimonial_job ) {
@@ -614,10 +565,10 @@
614 565 imageUrl = elementor.imagesManager.getImageUrl( image );
615 566 hasImage = ' elementor-has-image';
616 567
617 568 var imageHtml = '<img src="' + _.escape( imageUrl ) + '" alt="testimonial" />';
618 - if ( settings.link?.url ) {
619 - imageHtml = '<a href="' + elementor.helpers.sanitizeUrl( settings.link?.url ) + '">' + imageHtml + '</a>';
569 + if ( settings.link.url ) {
570 + imageHtml = '<a href="' + _.escape( settings.link.url ) + '">' + imageHtml + '</a>';
620 571 }
621 572 }
622 573
623 574 var testimonial_image_position = settings.testimonial_image_position ? ' elementor-testimonial-image-position-' + settings.testimonial_image_position : '';
@@ -626,19 +577,14 @@
626 577 <# if ( '' !== settings.testimonial_content ) {
627 578 view.addRenderAttribute( 'testimonial_content', {
628 579 'data-binding-type': 'content',
629 580 'data-binding-setting': 'testimonial_content',
630 - 'data-binding-config': JSON.stringify({
631 - 'testimonial_content': {
632 - editType: "text"
633 - }
634 - })
635 581 } );
636 582 view.addRenderAttribute( 'testimonial_content', 'class', 'elementor-testimonial-content' );
637 583
638 584 view.addInlineEditingAttributes( 'testimonial_content' );
639 585 #>
640 - <div {{{ view.getRenderAttributeString( 'testimonial_content' ) }}}>{{ settings.testimonial_content }}</div>
586 + <div {{{ view.getRenderAttributeString( 'testimonial_content' ) }}}>{{{ settings.testimonial_content }}}</div>
641 587 <# } #>
642 588 <div class="elementor-testimonial-meta{{ hasImage }}{{ testimonial_image_position }}">
643 589 <div class="elementor-testimonial-meta-inner">
644 590 <# if ( imageUrl ) { #>
@@ -660,15 +606,15 @@
660 606 view.addRenderAttribute( 'testimonial_name', 'class', 'elementor-testimonial-name' );
661 607
662 608 view.addInlineEditingAttributes( 'testimonial_name', 'none' );
663 609
664 - if ( settings.link?.url ) {
610 + if ( settings.link.url ) {
665 611 #>
666 - <a href="{{ elementor.helpers.sanitizeUrl( settings.link?.url ) }}" {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{ settings.testimonial_name }}</a>
612 + <a href="{{ settings.link.url }}" {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{{ settings.testimonial_name }}}</a>
667 613 <#
668 614 } else {
669 615 #>
670 - <div {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{ settings.testimonial_name }}</div>
616 + <div {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{{ settings.testimonial_name }}}</div>
671 617 <#
672 618 }
673 619 }
674 620
@@ -676,15 +622,15 @@
676 622 view.addRenderAttribute( 'testimonial_job', 'class', 'elementor-testimonial-job' );
677 623
678 624 view.addInlineEditingAttributes( 'testimonial_job', 'none' );
679 625
680 - if ( settings.link?.url ) {
626 + if ( settings.link.url ) {
681 627 #>
682 - <a href="{{ elementor.helpers.sanitizeUrl( settings.link?.url ) }}" {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{ settings.testimonial_job }}</a>
628 + <a href="{{ settings.link.url }}" {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{{ settings.testimonial_job }}}</a>
683 629 <#
684 630 } else {
685 631 #>
686 - <div {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{ settings.testimonial_job }}</div>
632 + <div {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{{ settings.testimonial_job }}}</div>
687 633 <#
688 634 }
689 635 }
690 636 #>