PluginProbe
Elementor Website Builder – more than just a page builder / 3.21.0-beta2
Elementor Website Builder – more than just a page builder v3.21.0-beta2
4.3.3 4.3.2 4.3.1 4.3.0 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 All 456 releases
← All changes | includes/widgets/testimonial.php +21 -53 4.0.9 → 3.21.0-beta2 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 *
@@ -73,31 +72,9 @@
73 72 public function get_keywords() {
74 73 return [ 'testimonial', 'blockquote' ];
75 74 }
76 75
77 - protected function is_dynamic_content(): bool {
78 - return false;
79 - }
80 -
81 76 /**
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 77 * Get widget upsale data.
101 78 *
102 79 * Retrieve the widget promotion data.
103 80 *
@@ -208,8 +185,10 @@
208 185 ],
209 186 ]
210 187 );
211 188
189 + $aside = is_rtl() ? 'right' : 'left';
190 +
212 191 $this->add_control(
213 192 'testimonial_image_position',
214 193 [
215 194 'label' => esc_html__( 'Image Position', 'elementor' ),
@@ -217,9 +196,9 @@
217 196 'default' => 'aside',
218 197 'options' => [
219 198 'aside' => [
220 199 'title' => esc_html__( 'Aside', 'elementor' ),
221 - 'icon' => 'eicon-h-align-left',
200 + 'icon' => 'eicon-h-align-' . $aside,
222 201 ],
223 202 'top' => [
224 203 'title' => esc_html__( 'Top', 'elementor' ),
225 204 'icon' => 'eicon-v-align-top',
@@ -229,9 +208,8 @@
229 208 'condition' => [
230 209 'testimonial_image[url]!' => '',
231 210 ],
232 211 'separator' => 'before',
233 - 'classes' => 'elementor-control-start-end',
234 212 'style_transfer' => true,
235 213 ]
236 214 );
237 215
@@ -241,10 +219,10 @@
241 219 'label' => esc_html__( 'Alignment', 'elementor' ),
242 220 'type' => Controls_Manager::CHOOSE,
243 221 'default' => 'center',
244 222 'options' => [
245 - 'start' => [
246 - 'title' => esc_html__( 'Start', 'elementor' ),
223 + 'left' => [
224 + 'title' => esc_html__( 'Left', 'elementor' ),
247 225 'icon' => 'eicon-text-align-left',
248 226 ],
249 227 'center' => [
250 228 'title' => esc_html__( 'Center', 'elementor' ),
@@ -249,18 +227,13 @@
249 227 'center' => [
250 228 'title' => esc_html__( 'Center', 'elementor' ),
251 229 'icon' => 'eicon-text-align-center',
252 230 ],
253 - 'end' => [
254 - 'title' => esc_html__( 'End', 'elementor' ),
231 + 'right' => [
232 + 'title' => esc_html__( 'Right', 'elementor' ),
255 233 'icon' => 'eicon-text-align-right',
256 234 ],
257 235 ],
258 - 'classes' => 'elementor-control-start-end',
259 - 'selectors_dictionary' => [
260 - 'left' => is_rtl() ? 'end' : 'start',
261 - 'right' => is_rtl() ? 'start' : 'end',
262 - ],
263 236 'selectors' => [
264 237 '{{WRAPPER}} .elementor-testimonial-wrapper' => 'text-align: {{VALUE}}',
265 238 ],
266 239 'style_transfer' => true,
@@ -499,9 +472,9 @@
499 472 if ( $has_content ) :
500 473 $this->add_render_attribute( 'testimonial_content', 'class', 'elementor-testimonial-content' );
501 474 $this->add_inline_editing_attributes( 'testimonial_content' );
502 475 ?>
503 - <div <?php $this->print_render_attribute_string( 'testimonial_content' ); ?>><?php echo wp_kses_post( $settings['testimonial_content'] ); ?></div>
476 + <div <?php $this->print_render_attribute_string( 'testimonial_content' ); ?>><?php $this->print_unescaped_setting( 'testimonial_content' ); ?></div>
504 477 <?php endif; ?>
505 478
506 479 <?php if ( $has_image || $has_name || $has_job ) : ?>
507 480 <div <?php $this->print_render_attribute_string( 'meta' ); ?>>
@@ -526,13 +499,13 @@
526 499 $this->add_inline_editing_attributes( 'testimonial_name', 'none' );
527 500
528 501 if ( ! empty( $settings['link']['url'] ) ) :
529 502 ?>
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>
503 + <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 504 <?php
532 505 else :
533 506 ?>
534 - <div <?php $this->print_render_attribute_string( 'testimonial_name' ); ?>><?php echo wp_kses_post( $settings['testimonial_name'] ); ?></div>
507 + <div <?php $this->print_render_attribute_string( 'testimonial_name' ); ?>><?php $this->print_unescaped_setting( 'testimonial_name' ); ?></div>
535 508 <?php
536 509 endif;
537 510 endif; ?>
538 511 <?php
@@ -542,13 +515,13 @@
542 515 $this->add_inline_editing_attributes( 'testimonial_job', 'none' );
543 516
544 517 if ( ! empty( $settings['link']['url'] ) ) :
545 518 ?>
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>
519 + <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 520 <?php
548 521 else :
549 522 ?>
550 - <div <?php $this->print_render_attribute_string( 'testimonial_job' ); ?>><?php echo wp_kses_post( $settings['testimonial_job'] ); ?></div>
523 + <div <?php $this->print_render_attribute_string( 'testimonial_job' ); ?>><?php $this->print_unescaped_setting( 'testimonial_job' ); ?></div>
551 524 <?php
552 525 endif;
553 526 endif; ?>
554 527 </div>
@@ -588,10 +561,10 @@
588 561 imageUrl = elementor.imagesManager.getImageUrl( image );
589 562 hasImage = ' elementor-has-image';
590 563
591 564 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>';
565 + if ( settings.link.url ) {
566 + imageHtml = '<a href="' + _.escape( settings.link.url ) + '">' + imageHtml + '</a>';
594 567 }
595 568 }
596 569
597 570 var testimonial_image_position = settings.testimonial_image_position ? ' elementor-testimonial-image-position-' + settings.testimonial_image_position : '';
@@ -600,19 +573,14 @@
600 573 <# if ( '' !== settings.testimonial_content ) {
601 574 view.addRenderAttribute( 'testimonial_content', {
602 575 'data-binding-type': 'content',
603 576 'data-binding-setting': 'testimonial_content',
604 - 'data-binding-config': JSON.stringify({
605 - 'testimonial_content': {
606 - editType: "text"
607 - }
608 - })
609 577 } );
610 578 view.addRenderAttribute( 'testimonial_content', 'class', 'elementor-testimonial-content' );
611 579
612 580 view.addInlineEditingAttributes( 'testimonial_content' );
613 581 #>
614 - <div {{{ view.getRenderAttributeString( 'testimonial_content' ) }}}>{{ settings.testimonial_content }}</div>
582 + <div {{{ view.getRenderAttributeString( 'testimonial_content' ) }}}>{{{ settings.testimonial_content }}}</div>
615 583 <# } #>
616 584 <div class="elementor-testimonial-meta{{ hasImage }}{{ testimonial_image_position }}">
617 585 <div class="elementor-testimonial-meta-inner">
618 586 <# if ( imageUrl ) { #>
@@ -634,15 +602,15 @@
634 602 view.addRenderAttribute( 'testimonial_name', 'class', 'elementor-testimonial-name' );
635 603
636 604 view.addInlineEditingAttributes( 'testimonial_name', 'none' );
637 605
638 - if ( settings.link?.url ) {
606 + if ( settings.link.url ) {
639 607 #>
640 - <a href="{{ elementor.helpers.sanitizeUrl( settings.link?.url ) }}" {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{ settings.testimonial_name }}</a>
608 + <a href="{{ settings.link.url }}" {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{{ settings.testimonial_name }}}</a>
641 609 <#
642 610 } else {
643 611 #>
644 - <div {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{ settings.testimonial_name }}</div>
612 + <div {{{ view.getRenderAttributeString( 'testimonial_name' ) }}}>{{{ settings.testimonial_name }}}</div>
645 613 <#
646 614 }
647 615 }
648 616
@@ -650,15 +618,15 @@
650 618 view.addRenderAttribute( 'testimonial_job', 'class', 'elementor-testimonial-job' );
651 619
652 620 view.addInlineEditingAttributes( 'testimonial_job', 'none' );
653 621
654 - if ( settings.link?.url ) {
622 + if ( settings.link.url ) {
655 623 #>
656 - <a href="{{ elementor.helpers.sanitizeUrl( settings.link?.url ) }}" {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{ settings.testimonial_job }}</a>
624 + <a href="{{ settings.link.url }}" {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{{ settings.testimonial_job }}}</a>
657 625 <#
658 626 } else {
659 627 #>
660 - <div {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{ settings.testimonial_job }}</div>
628 + <div {{{ view.getRenderAttributeString( 'testimonial_job' ) }}}>{{{ settings.testimonial_job }}}</div>
661 629 <#
662 630 }
663 631 }
664 632 #>