PluginProbe
Elementor Website Builder – more than just a page builder / 3.7.3
Elementor Website Builder – more than just a page builder v3.7.3
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 4.0.7 All 451 releases
← All changes | includes/base/element-base.php +32 -708 4.0.73.7.3 View file →
@@ -1,9 +1,7 @@
1 1 <?php
2 2 namespace Elementor;
3 3
4 -use Elementor\Core\Breakpoints\Manager as Breakpoints_Manager;
5 -
6 4 if ( ! defined( 'ABSPATH' ) ) {
7 5 exit; // Exit if accessed directly.
8 6 }
9 7
@@ -119,12 +117,8 @@
119 117 public function get_script_depends() {
120 118 return $this->depended_scripts;
121 119 }
122 120
123 - public function get_global_scripts() {
124 - return [ 'elementor-frontend' ];
125 - }
126 -
127 121 /**
128 122 * Enqueue scripts.
129 123 *
130 124 * Registers all the scripts defined as element dependencies and enqueues
@@ -134,9 +128,9 @@
134 128 * @access public
135 129 */
136 130 final public function enqueue_scripts() {
137 131 $deprecated_scripts = [
138 - // Insert here when you have a deprecated script.
132 + //Insert here when you have a deprecated script
139 133 ];
140 134
141 135 foreach ( $this->get_script_depends() as $script ) {
142 136 if ( isset( $deprecated_scripts[ $script ] ) ) {
@@ -144,16 +138,10 @@
144 138 }
145 139
146 140 wp_enqueue_script( $script );
147 141 }
148 -
149 - foreach ( $this->get_global_scripts() as $script ) {
150 - wp_enqueue_script( $script );
151 - }
152 142 }
153 143
154 - public function register_frontend_handlers() {}
155 -
156 144 /**
157 145 * Get style dependencies.
158 146 *
159 147 * Retrieve the list of style dependencies the element requires.
@@ -295,22 +283,8 @@
295 283 return true;
296 284 }
297 285
298 286 /**
299 - * Whether the element returns dynamic content.
300 - *
301 - * Set to determine whether to cache the element output or not.
302 - *
303 - * @since 3.22.0
304 - * @access protected
305 - *
306 - * @return bool Whether to cache the element output.
307 - */
308 - protected function is_dynamic_content(): bool {
309 - return true;
310 - }
311 -
312 - /**
313 287 * Get child elements.
314 288 *
315 289 * Retrieve all the child elements of this element.
316 290 *
@@ -344,23 +318,8 @@
344 318 return self::get_items( $this->default_args, $item );
345 319 }
346 320
347 321 /**
348 - * Get panel presets.
349 - *
350 - * Used for displaying the widget in the panel multiple times, but with different defaults values,
351 - * icon, title etc.
352 - *
353 - * @since 3.16.0
354 - * @access public
355 - *
356 - * @return array
357 - */
358 - public function get_panel_presets() {
359 - return [];
360 - }
361 -
362 - /**
363 322 * Add new child element.
364 323 *
365 324 * Register new child element to allow hierarchy.
366 325 *
@@ -406,14 +365,15 @@
406 365 * @since 2.8.0
407 366 * @access public
408 367 *
409 368 * @param array|string $element The HTML element.
410 - * @param array $url_control Array of link settings.
411 - * @param bool $overwrite Optional. Whether to overwrite existing
412 - * attribute. Default is false, not to overwrite.
369 + * @param array $url_control Array of link settings.
370 + * @param bool $overwrite Optional. Whether to overwrite existing
371 + * attribute. Default is false, not to overwrite.
413 372 *
414 373 * @return Element_Base Current instance of the element.
415 374 */
375 +
416 376 public function add_link_attributes( $element, array $url_control, $overwrite = false ) {
417 377 $attributes = [];
418 378
419 379 if ( ! empty( $url_control['url'] ) ) {
@@ -430,9 +390,9 @@
430 390 $attributes['rel'] = 'nofollow';
431 391 }
432 392
433 393 if ( ! empty( $url_control['custom_attributes'] ) ) {
434 - // Custom URL attributes should come as a string of comma-delimited key|value pairs.
394 + // Custom URL attributes should come as a string of comma-delimited key|value pairs
435 395 $attributes = array_merge( $attributes, Utils::parse_custom_attributes( $url_control['custom_attributes'] ) );
436 396 }
437 397
438 398 if ( $attributes ) {
@@ -452,15 +412,8 @@
452 412 */
453 413 public function print_element() {
454 414 $element_type = $this->get_type();
455 415
456 - if ( $this->should_render_shortcode() ) {
457 - $unique_id = apply_filters( 'elementor/element_cache/unique_id', '' );
458 -
459 - echo '[elementor-element k="' . esc_attr( $unique_id ) . '" data="' . esc_attr( base64_encode( wp_json_encode( $this->get_raw_data() ) ) ) . '"]';
460 - return;
461 - }
462 -
463 416 /**
464 417 * Before frontend element render.
465 418 *
466 419 * Fires before Elementor element is rendered in the frontend.
@@ -523,10 +476,8 @@
523 476 // PHPCS - The content has already been escaped by the `render` method.
524 477 echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
525 478 $this->after_render();
526 479
527 - // TODO: Remove this in the future
528 - // Since version 3.24.0 page scripts/styles are handled by `page_assets`.
529 480 $this->enqueue_scripts();
530 481 $this->enqueue_styles();
531 482 }
532 483
@@ -554,54 +505,8 @@
554 505 */
555 506 do_action( 'elementor/frontend/after_render', $this );
556 507 }
557 508
558 - protected function should_render_shortcode() {
559 - $should_render_shortcode = apply_filters( 'elementor/element/should_render_shortcode', false );
560 -
561 - if ( ! $should_render_shortcode ) {
562 - return false;
563 - }
564 -
565 - $raw_data = $this->get_raw_data();
566 -
567 - if ( ! empty( $raw_data['settings']['_element_cache'] ) ) {
568 - return 'yes' === $raw_data['settings']['_element_cache'];
569 - }
570 -
571 - if ( $this->is_dynamic_content() ) {
572 - return true;
573 - }
574 -
575 - $is_dynamic_content = apply_filters( 'elementor/element/is_dynamic_content', false, $raw_data, $this );
576 -
577 - $has_dynamic_tag = $this->has_element_dynamic_tag( $raw_data['settings'] );
578 -
579 - if ( $is_dynamic_content || $has_dynamic_tag ) {
580 - return true;
581 - }
582 -
583 - return false;
584 - }
585 -
586 - private function has_element_dynamic_tag( $element_settings ): bool {
587 - if ( is_array( $element_settings ) ) {
588 - if ( ! empty( $element_settings['__dynamic__'] ) ) {
589 - return true;
590 - }
591 -
592 - foreach ( $element_settings as $value ) {
593 - $has_dynamic = $this->has_element_dynamic_tag( $value );
594 -
595 - if ( $has_dynamic ) {
596 - return true;
597 - }
598 - }
599 - }
600 -
601 - return false;
602 - }
603 -
604 509 /**
605 510 * Get the element raw data.
606 511 *
607 512 * Retrieve the raw element data, including the id, type, settings, child
@@ -628,9 +533,9 @@
628 533 foreach ( $this->get_children() as $child ) {
629 534 $elements[] = $child->get_raw_data( $with_html_content );
630 535 }
631 536
632 - $raw_data = [
537 + return [
633 538 'id' => $this->get_id(),
634 539 'elType' => $data['elType'],
635 540 'settings' => $data['settings'],
636 541 'elements' => $elements,
@@ -635,14 +540,8 @@
635 540 'settings' => $data['settings'],
636 541 'elements' => $elements,
637 542 'isInner' => $data['isInner'],
638 543 ];
639 -
640 - if ( ! empty( $data['isLocked'] ) ) {
641 - $raw_data['isLocked'] = $data['isLocked'];
642 - }
643 -
644 - return $raw_data;
645 544 }
646 545
647 546 public function get_data_for_save() {
648 547 $data = $this->get_raw_data();
@@ -694,41 +593,28 @@
694 593 return $this->is_type_instance;
695 594 }
696 595
697 596 /**
698 - * On import update dynamic content (e.g. post and term IDs).
597 + * On Import Replace Dynamic Content.
699 598 *
700 - * @since 3.8.0
599 + * @since 3.6.0
600 + * @access public
701 601 *
702 - * @param array $config The config of the passed element.
703 - * @param array $data The data that requires updating/replacement when imported.
704 - * @param array|null $controls The available controls.
705 - *
706 602 * @return array Element data.
707 603 */
708 - public static function on_import_update_dynamic_content( array $config, array $data, $controls = null ): array {
604 + public static function on_import_replace_dynamic_content( $config, $map_old_new_post_ids ) {
709 605 $tags_manager = Plugin::$instance->dynamic_tags;
710 606
711 - if ( empty( $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ] ) ) {
712 - return $config;
713 - }
607 + if ( isset( $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ] ) ) {
608 + foreach ( $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ] as $dynamic_name => $dynamic_value ) {
609 + $tag_config = $tags_manager->tag_text_to_tag_data( $dynamic_value );
610 + $tag_instance = $tags_manager->create_tag( $tag_config['id'], $tag_config['name'], $tag_config['settings'] );
714 611
715 - foreach ( $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ] as $dynamic_name => $dynamic_value ) {
716 - $tag_config = $tags_manager->tag_text_to_tag_data( $dynamic_value );
717 - $tag_instance = $tags_manager->create_tag( $tag_config['id'], $tag_config['name'], $tag_config['settings'] );
718 -
719 - if ( is_null( $tag_instance ) ) {
720 - continue;
612 + if ( $tag_instance ) {
613 + $tag_config = $tag_instance->on_import_replace_dynamic_content( $tag_config, $map_old_new_post_ids );
614 + $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ][ $dynamic_name ] = $tags_manager->tag_data_to_tag_text( $tag_config['id'], $tag_config['name'], $tag_config['settings'] );
615 + }
721 616 }
722 -
723 - if ( $tag_instance->has_own_method( 'on_import_replace_dynamic_content' ) ) {
724 - // TODO: Remove this check in the future.
725 - $tag_config = $tag_instance->on_import_replace_dynamic_content( $tag_config, $data['post_ids'] );
726 - } else {
727 - $tag_config = $tag_instance->on_import_update_dynamic_content( $tag_config, $data, $tag_instance->get_controls() );
728 - }
729 -
730 - $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ][ $dynamic_name ] = $tags_manager->tag_data_to_tag_text( $tag_config['id'], $tag_config['name'], $tag_config['settings'] );
731 617 }
732 618
733 619 return $config;
734 620 }
@@ -739,12 +625,12 @@
739 625 * Used to add attributes to the current element wrapper HTML tag.
740 626 *
741 627 * @since 1.3.0
742 628 * @access protected
743 - * @deprecated 3.1.0 Use `add_render_attribute()` method instead.
629 + * @deprecated 3.1.0
744 630 */
745 631 protected function _add_render_attributes() {
746 - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', 'add_render_attributes()' );
632 + Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', __CLASS__ . '::add_render_attributes()' );
747 633
748 634 return $this->add_render_attributes();
749 635 }
750 636
@@ -769,9 +655,8 @@
769 655 'elementor-element-' . $id,
770 656 ],
771 657 'data-id' => $id,
772 658 'data-element_type' => $this->get_type(),
773 - 'data-e-type' => $this->get_type(),
774 659 ] );
775 660
776 661 $class_settings = [];
777 662
@@ -776,15 +661,9 @@
776 661 $class_settings = [];
777 662
778 663 foreach ( $settings as $setting_key => $setting ) {
779 664 if ( isset( $controls[ $setting_key ]['prefix_class'] ) ) {
780 - if ( isset( $controls[ $setting_key ]['classes_dictionary'][ $setting ] ) ) {
781 - $value = $controls[ $setting_key ]['classes_dictionary'][ $setting ];
782 - } else {
783 - $value = $setting;
784 - }
785 -
786 - $class_settings[ $setting_key ] = $value;
665 + $class_settings[ $setting_key ] = $setting;
787 666 }
788 667 }
789 668
790 669 foreach ( $class_settings as $setting_key => $setting ) {
@@ -796,15 +675,15 @@
796 675 }
797 676
798 677 $_animation = ! empty( $settings['_animation'] );
799 678 $animation = ! empty( $settings['animation'] );
800 - $has_animation = ( $_animation && 'none' !== $settings['_animation'] ) || ( $animation && 'none' !== $settings['animation'] );
679 + $has_animation = $_animation && 'none' !== $settings['_animation'] || $animation && 'none' !== $settings['animation'];
801 680
802 681 if ( $has_animation ) {
803 682 $is_static_render_mode = Plugin::$instance->frontend->is_static_render_mode();
804 683
805 684 if ( ! $is_static_render_mode ) {
806 - // Hide the element until the animation begins.
685 + // Hide the element until the animation begins
807 686 $this->add_render_attribute( '_wrapper', 'class', 'elementor-invisible' );
808 687 }
809 688 }
810 689
@@ -828,552 +707,8 @@
828 707 do_action( 'elementor/element/after_add_attributes', $this );
829 708 }
830 709
831 710 /**
832 - * Register the Transform controls in the advanced tab of the element.
833 - *
834 - * Previously registered under the Widget_Common class, but registered a more fundamental level now to enable access from other widgets.
835 - *
836 - * @param string $element_selector
837 - * @param string $transform_selector_class
838 - * @return void
839 - * @since 3.9.0
840 - * @access protected
841 - */
842 - protected function register_transform_section( $element_selector = '', $transform_selector_class = ' > .elementor-widget-container' ) {
843 - $default_unit_values_deg = [];
844 - $default_unit_values_ms = [];
845 -
846 - // Set the default unit sizes for all active breakpoints.
847 - foreach ( Breakpoints_Manager::get_default_config() as $breakpoint_name => $breakpoint_config ) {
848 - $default_unit_values_deg[ $breakpoint_name ] = [
849 - 'default' => [
850 - 'unit' => 'deg',
851 - ],
852 - ];
853 -
854 - $default_unit_values_ms[ $breakpoint_name ] = [
855 - 'default' => [
856 - 'unit' => 'ms',
857 - ],
858 - ];
859 - }
860 -
861 - $this->start_controls_section(
862 - '_section_transform',
863 - [
864 - 'label' => esc_html__( 'Transform', 'elementor' ),
865 - 'tab' => Controls_Manager::TAB_ADVANCED,
866 - ]
867 - );
868 -
869 - $this->start_controls_tabs( '_tabs_positioning' );
870 -
871 - $transform_prefix_class = 'e-';
872 - $transform_return_value = 'transform';
873 - $transform_css_modifier = '';
874 -
875 - if ( 'con' === $element_selector ) {
876 - $transform_selector_class = '.e-' . $element_selector;
877 - $transform_css_modifier = $element_selector . '-';
878 - }
879 -
880 - foreach ( [ '', '_hover' ] as $tab ) {
881 - $state = '_hover' === $tab ? ':hover' : '';
882 -
883 - $this->start_controls_tab(
884 - "_tab_positioning{$tab}",
885 - [
886 - 'label' => '' === $tab ? esc_html__( 'Normal', 'elementor' ) : esc_html__( 'Hover', 'elementor' ),
887 - ]
888 - );
889 -
890 - $this->add_control(
891 - "_transform_rotate_popover{$tab}",
892 - [
893 - 'label' => esc_html__( 'Rotate', 'elementor' ),
894 - 'type' => Controls_Manager::POPOVER_TOGGLE,
895 - 'prefix_class' => $transform_prefix_class,
896 - 'return_value' => $transform_return_value,
897 - ]
898 - );
899 -
900 - $this->start_popover();
901 -
902 - $this->add_responsive_control(
903 - "_transform_rotateZ_effect{$tab}",
904 - [
905 - 'label' => esc_html__( 'Rotate', 'elementor' ) . ' (deg)',
906 - 'type' => Controls_Manager::SLIDER,
907 - 'device_args' => $default_unit_values_deg,
908 - 'range' => [
909 - 'px' => [
910 - 'min' => -360,
911 - 'max' => 360,
912 - ],
913 - ],
914 - 'selectors' => [
915 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-rotateZ: {{SIZE}}deg',
916 - ],
917 - 'condition' => [
918 - "_transform_rotate_popover{$tab}!" => '',
919 - ],
920 - 'frontend_available' => true,
921 - ]
922 - );
923 -
924 - $this->add_control(
925 - "_transform_rotate_3d{$tab}",
926 - [
927 - 'label' => esc_html__( '3D Rotate', 'elementor' ),
928 - 'type' => Controls_Manager::SWITCHER,
929 - 'label_on' => esc_html__( 'On', 'elementor' ),
930 - 'label_off' => esc_html__( 'Off', 'elementor' ),
931 - 'selectors' => [
932 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-rotateX: 1{{UNIT}}; --e-' . $transform_css_modifier . 'transform-perspective: 20px;',
933 - ],
934 - 'condition' => [
935 - "_transform_rotate_popover{$tab}!" => '',
936 - ],
937 - 'frontend_available' => true,
938 - ]
939 - );
940 -
941 - $this->add_responsive_control(
942 - "_transform_rotateX_effect{$tab}",
943 - [
944 - 'label' => esc_html__( 'Rotate X', 'elementor' ) . ' (deg)',
945 - 'type' => Controls_Manager::SLIDER,
946 - 'device_args' => $default_unit_values_deg,
947 - 'range' => [
948 - 'px' => [
949 - 'min' => -360,
950 - 'max' => 360,
951 - ],
952 - ],
953 - 'condition' => [
954 - "_transform_rotate_3d{$tab}!" => '',
955 - "_transform_rotate_popover{$tab}!" => '',
956 - ],
957 - 'selectors' => [
958 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-rotateX: {{SIZE}}deg;',
959 - ],
960 - 'frontend_available' => true,
961 - ]
962 - );
963 -
964 - $this->add_responsive_control(
965 - "_transform_rotateY_effect{$tab}",
966 - [
967 - 'label' => esc_html__( 'Rotate Y', 'elementor' ) . ' (deg)',
968 - 'type' => Controls_Manager::SLIDER,
969 - 'device_args' => $default_unit_values_deg,
970 - 'range' => [
971 - 'px' => [
972 - 'min' => -360,
973 - 'max' => 360,
974 - ],
975 - ],
976 - 'condition' => [
977 - "_transform_rotate_3d{$tab}!" => '',
978 - "_transform_rotate_popover{$tab}!" => '',
979 - ],
980 - 'selectors' => [
981 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-rotateY: {{SIZE}}deg;',
982 - ],
983 - 'frontend_available' => true,
984 - ]
985 - );
986 -
987 - $this->add_responsive_control(
988 - "_transform_perspective_effect{$tab}",
989 - [
990 - 'label' => esc_html__( 'Perspective', 'elementor' ) . ' (px)',
991 - 'type' => Controls_Manager::SLIDER,
992 - 'range' => [
993 - 'px' => [
994 - 'max' => 1000,
995 - ],
996 - ],
997 - 'condition' => [
998 - "_transform_rotate_popover{$tab}!" => '',
999 - "_transform_rotate_3d{$tab}!" => '',
1000 - ],
1001 - 'selectors' => [
1002 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-perspective: {{SIZE}}px',
1003 - ],
1004 - 'frontend_available' => true,
1005 - ]
1006 - );
1007 -
1008 - $this->end_popover();
1009 -
1010 - $this->add_control(
1011 - "_transform_translate_popover{$tab}",
1012 - [
1013 - 'label' => esc_html__( 'Offset', 'elementor' ),
1014 - 'type' => Controls_Manager::POPOVER_TOGGLE,
1015 - 'prefix_class' => $transform_prefix_class,
1016 - 'return_value' => $transform_return_value,
1017 - ]
1018 - );
1019 -
1020 - $this->start_popover();
1021 -
1022 - $this->add_responsive_control(
1023 - "_transform_translateX_effect{$tab}",
1024 - [
1025 - 'label' => esc_html__( 'Offset X', 'elementor' ),
1026 - 'type' => Controls_Manager::SLIDER,
1027 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1028 - 'range' => [
1029 - '%' => [
1030 - 'min' => -100,
1031 - 'max' => 100,
1032 - ],
1033 - 'px' => [
1034 - 'min' => -1000,
1035 - 'max' => 1000,
1036 - ],
1037 - ],
1038 - 'condition' => [
1039 - "_transform_translate_popover{$tab}!" => '',
1040 - ],
1041 - 'selectors' => [
1042 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-translateX: {{SIZE}}{{UNIT}};',
1043 - ],
1044 - 'frontend_available' => true,
1045 - ]
1046 - );
1047 -
1048 - $this->add_responsive_control(
1049 - "_transform_translateY_effect{$tab}",
1050 - [
1051 - 'label' => esc_html__( 'Offset Y', 'elementor' ),
1052 - 'type' => Controls_Manager::SLIDER,
1053 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'custom' ],
1054 - 'range' => [
1055 - '%' => [
1056 - 'min' => -100,
1057 - 'max' => 100,
1058 - ],
1059 - 'px' => [
1060 - 'min' => -1000,
1061 - 'max' => 1000,
1062 - ],
1063 - ],
1064 - 'condition' => [
1065 - "_transform_translate_popover{$tab}!" => '',
1066 - ],
1067 - 'selectors' => [
1068 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-translateY: {{SIZE}}{{UNIT}};',
1069 - ],
1070 - 'frontend_available' => true,
1071 - ]
1072 - );
1073 -
1074 - $this->end_popover();
1075 -
1076 - $this->add_control(
1077 - "_transform_scale_popover{$tab}",
1078 - [
1079 - 'label' => esc_html__( 'Scale', 'elementor' ),
1080 - 'type' => Controls_Manager::POPOVER_TOGGLE,
1081 - 'prefix_class' => $transform_prefix_class,
1082 - 'return_value' => $transform_return_value,
1083 - ]
1084 - );
1085 -
1086 - $this->start_popover();
1087 -
1088 - $this->add_control(
1089 - "_transform_keep_proportions{$tab}",
1090 - [
1091 - 'label' => esc_html__( 'Keep Proportions', 'elementor' ),
1092 - 'type' => Controls_Manager::SWITCHER,
1093 - 'label_on' => esc_html__( 'On', 'elementor' ),
1094 - 'label_off' => esc_html__( 'Off', 'elementor' ),
1095 - 'default' => 'yes',
1096 - ]
1097 - );
1098 -
1099 - $this->add_responsive_control(
1100 - "_transform_scale_effect{$tab}",
1101 - [
1102 - 'label' => esc_html__( 'Scale', 'elementor' ),
1103 - 'type' => Controls_Manager::SLIDER,
1104 - 'range' => [
1105 - 'px' => [
1106 - 'max' => 2,
1107 - 'step' => 0.1,
1108 - ],
1109 - ],
1110 - 'condition' => [
1111 - "_transform_scale_popover{$tab}!" => '',
1112 - "_transform_keep_proportions{$tab}!" => '',
1113 - ],
1114 - 'selectors' => [
1115 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-scale: {{SIZE}};',
1116 - ],
1117 - 'frontend_available' => true,
1118 - ]
1119 - );
1120 -
1121 - $this->add_responsive_control(
1122 - "_transform_scaleX_effect{$tab}",
1123 - [
1124 - 'label' => esc_html__( 'Scale X', 'elementor' ),
1125 - 'type' => Controls_Manager::SLIDER,
1126 - 'range' => [
1127 - 'px' => [
1128 - 'max' => 2,
1129 - 'step' => 0.1,
1130 - ],
1131 - ],
1132 - 'condition' => [
1133 - "_transform_scale_popover{$tab}!" => '',
1134 - "_transform_keep_proportions{$tab}" => '',
1135 - ],
1136 - 'selectors' => [
1137 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-scaleX: {{SIZE}};',
1138 - ],
1139 - 'frontend_available' => true,
1140 - ]
1141 - );
1142 -
1143 - $this->add_responsive_control(
1144 - "_transform_scaleY_effect{$tab}",
1145 - [
1146 - 'label' => esc_html__( 'Scale Y', 'elementor' ),
1147 - 'type' => Controls_Manager::SLIDER,
1148 - 'range' => [
1149 - 'px' => [
1150 - 'max' => 2,
1151 - 'step' => 0.1,
1152 - ],
1153 - ],
1154 - 'condition' => [
1155 - "_transform_scale_popover{$tab}!" => '',
1156 - "_transform_keep_proportions{$tab}" => '',
1157 - ],
1158 - 'selectors' => [
1159 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-scaleY: {{SIZE}};',
1160 - ],
1161 - 'frontend_available' => true,
1162 - ]
1163 - );
1164 -
1165 - $this->end_popover();
1166 -
1167 - $this->add_control(
1168 - "_transform_skew_popover{$tab}",
1169 - [
1170 - 'label' => esc_html__( 'Skew', 'elementor' ),
1171 - 'type' => Controls_Manager::POPOVER_TOGGLE,
1172 - 'prefix_class' => $transform_prefix_class,
1173 - 'return_value' => $transform_return_value,
1174 - ]
1175 - );
1176 -
1177 - $this->start_popover();
1178 -
1179 - $this->add_responsive_control(
1180 - "_transform_skewX_effect{$tab}",
1181 - [
1182 - 'label' => esc_html__( 'Skew X', 'elementor' ) . ' (deg)',
1183 - 'type' => Controls_Manager::SLIDER,
1184 - 'device_args' => $default_unit_values_deg,
1185 - 'range' => [
1186 - 'px' => [
1187 - 'min' => -360,
1188 - 'max' => 360,
1189 - ],
1190 - ],
1191 - 'condition' => [
1192 - "_transform_skew_popover{$tab}!" => '',
1193 - ],
1194 - 'selectors' => [
1195 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-skewX: {{SIZE}}deg;',
1196 - ],
1197 - 'frontend_available' => true,
1198 - ]
1199 - );
1200 -
1201 - $this->add_responsive_control(
1202 - "_transform_skewY_effect{$tab}",
1203 - [
1204 - 'label' => esc_html__( 'Skew Y', 'elementor' ) . ' (deg)',
1205 - 'type' => Controls_Manager::SLIDER,
1206 - 'device_args' => $default_unit_values_deg,
1207 - 'range' => [
1208 - 'px' => [
1209 - 'min' => -360,
1210 - 'max' => 360,
1211 - ],
1212 - ],
1213 - 'condition' => [
1214 - "_transform_skew_popover{$tab}!" => '',
1215 - ],
1216 - 'selectors' => [
1217 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-skewY: {{SIZE}}deg;',
1218 - ],
1219 - 'frontend_available' => true,
1220 - ]
1221 - );
1222 -
1223 - $this->end_popover();
1224 -
1225 - $this->add_control(
1226 - "_transform_flipX_effect{$tab}",
1227 - [
1228 - 'label' => esc_html__( 'Flip Horizontal', 'elementor' ),
1229 - 'type' => Controls_Manager::CHOOSE,
1230 - 'options' => [
1231 - 'transform' => [
1232 - 'title' => esc_html__( 'Flip Horizontal', 'elementor' ),
1233 - 'icon' => 'eicon-flip eicon-tilted',
1234 - ],
1235 - ],
1236 - 'prefix_class' => $transform_prefix_class,
1237 - 'selectors' => [
1238 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-flipX: -1',
1239 - ],
1240 - 'frontend_available' => true,
1241 - ]
1242 - );
1243 -
1244 - $this->add_control(
1245 - "_transform_flipY_effect{$tab}",
1246 - [
1247 - 'label' => esc_html__( 'Flip Vertical', 'elementor' ),
1248 - 'type' => Controls_Manager::CHOOSE,
1249 - 'options' => [
1250 - 'transform' => [
1251 - 'title' => esc_html__( 'Flip Vertical', 'elementor' ),
1252 - 'icon' => 'eicon-flip',
1253 - ],
1254 - ],
1255 - 'prefix_class' => $transform_prefix_class,
1256 - 'selectors' => [
1257 - "{{WRAPPER}}{$transform_selector_class}{$state}" => '--e-' . $transform_css_modifier . 'transform-flipY: -1',
1258 - ],
1259 - 'frontend_available' => true,
1260 - ]
1261 - );
1262 -
1263 - if ( '_hover' === $tab ) {
1264 - $this->add_control(
1265 - '_transform_transition_hover',
1266 - [
1267 - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (ms)',
1268 - 'type' => Controls_Manager::SLIDER,
1269 - 'device_args' => $default_unit_values_ms,
1270 - 'range' => [
1271 - 'px' => [
1272 - 'min' => 0,
1273 - 'max' => 10000,
1274 - 'step' => 100,
1275 - ],
1276 - ],
1277 - 'selectors' => [
1278 - '{{WRAPPER}}' => '--e-' . $transform_css_modifier . 'transform-transition-duration: {{SIZE}}ms',
1279 - ],
1280 - ]
1281 - );
1282 - }
1283 -
1284 - ${"transform_origin_conditions{$tab}"} = [
1285 - [
1286 - 'name' => "_transform_scale_popover{$tab}",
1287 - 'operator' => '!=',
1288 - 'value' => '',
1289 - ],
1290 - [
1291 - 'name' => "_transform_rotate_popover{$tab}",
1292 - 'operator' => '!=',
1293 - 'value' => '',
1294 - ],
1295 - [
1296 - 'name' => "_transform_flipX_effect{$tab}",
1297 - 'operator' => '!=',
1298 - 'value' => '',
1299 - ],
1300 - [
1301 - 'name' => "_transform_flipY_effect{$tab}",
1302 - 'operator' => '!=',
1303 - 'value' => '',
1304 - ],
1305 - ];
1306 -
1307 - $this->end_controls_tab();
1308 - }
1309 -
1310 - $this->end_controls_tabs();
1311 -
1312 - $transform_origin_conditions = [
1313 - 'relation' => 'or',
1314 - 'terms' => array_merge( $transform_origin_conditions, $transform_origin_conditions_hover ),
1315 - ];
1316 -
1317 - // Will override motion effect transform-origin.
1318 - $this->add_responsive_control(
1319 - 'motion_fx_transform_x_anchor_point',
1320 - [
1321 - 'label' => esc_html__( 'X Anchor Point', 'elementor' ),
1322 - 'type' => Controls_Manager::CHOOSE,
1323 - 'options' => [
1324 - 'left' => [
1325 - 'title' => esc_html__( 'Left', 'elementor' ),
1326 - 'icon' => 'eicon-h-align-left',
1327 - ],
1328 - 'center' => [
1329 - 'title' => esc_html__( 'Center', 'elementor' ),
1330 - 'icon' => 'eicon-h-align-center',
1331 - ],
1332 - 'right' => [
1333 - 'title' => esc_html__( 'Right', 'elementor' ),
1334 - 'icon' => 'eicon-h-align-right',
1335 - ],
1336 - ],
1337 - 'conditions' => $transform_origin_conditions,
1338 - 'separator' => 'before',
1339 - 'selectors' => [
1340 - '{{WRAPPER}}' => '--e-' . $transform_css_modifier . 'transform-origin-x: {{VALUE}}',
1341 - ],
1342 - ]
1343 - );
1344 -
1345 - // Will override motion effect transform-origin.
1346 - $this->add_responsive_control(
1347 - 'motion_fx_transform_y_anchor_point',
1348 - [
1349 - 'label' => esc_html__( 'Y Anchor Point', 'elementor' ),
1350 - 'type' => Controls_Manager::CHOOSE,
1351 - 'options' => [
1352 - 'top' => [
1353 - 'title' => esc_html__( 'Top', 'elementor' ),
1354 - 'icon' => 'eicon-v-align-top',
1355 - ],
1356 - 'center' => [
1357 - 'title' => esc_html__( 'Center', 'elementor' ),
1358 - 'icon' => 'eicon-v-align-middle',
1359 - ],
1360 - 'bottom' => [
1361 - 'title' => esc_html__( 'Bottom', 'elementor' ),
1362 - 'icon' => 'eicon-v-align-bottom',
1363 - ],
1364 - ],
1365 - 'conditions' => $transform_origin_conditions,
1366 - 'selectors' => [
1367 - '{{WRAPPER}}' => '--e-' . $transform_css_modifier . 'transform-origin-y: {{VALUE}}',
1368 - ],
1369 - ]
1370 - );
1371 -
1372 - $this->end_controls_section();
1373 - }
1374 -
1375 - /**
1376 711 * Add Hidden Device Controls
1377 712 *
1378 713 * Adds controls for hiding elements within certain devices' viewport widths. Adds a control for each active device.
1379 714 *
@@ -1385,23 +720,20 @@
1385 720 $active_devices = Plugin::$instance->breakpoints->get_active_devices_list( [ 'reverse' => true ] );
1386 721 $active_breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints();
1387 722
1388 723 foreach ( $active_devices as $breakpoint_key ) {
1389 - $label = 'desktop' === $breakpoint_key ? esc_html__( 'Desktop', 'elementor' ) : $active_breakpoints[ $breakpoint_key ]->get_label();
724 + $label = 'desktop' === $breakpoint_key ? __( 'Desktop', 'elementor' ) : $active_breakpoints[ $breakpoint_key ]->get_label();
1390 725
1391 726 $this->add_control(
1392 727 'hide_' . $breakpoint_key,
1393 728 [
1394 - 'label' => sprintf(
1395 - /* translators: %s: Device name. */
1396 - esc_html__( 'Hide On %s', 'elementor' ),
1397 - $label
1398 - ),
729 + /* translators: %s: Device name. */
730 + 'label' => sprintf( __( 'Hide On %s', 'elementor' ), $label ),
1399 731 'type' => Controls_Manager::SWITCHER,
1400 732 'default' => '',
1401 733 'prefix_class' => 'elementor-',
1402 - 'label_on' => esc_html__( 'Hide', 'elementor' ),
1403 - 'label_off' => esc_html__( 'Show', 'elementor' ),
734 + 'label_on' => __( 'Hide', 'elementor' ),
735 + 'label_off' => __( 'Show', 'elementor' ),
1404 736 'return_value' => 'hidden-' . $breakpoint_key,
1405 737 ]
1406 738 );
1407 739 }
@@ -1434,12 +766,11 @@
1434 766 * Output the element final HTML on the frontend.
1435 767 *
1436 768 * @since 1.0.0
1437 769 * @access protected
1438 - * @deprecated 3.1.0 Use `print_content()` method instead.
1439 770 */
1440 771 protected function _print_content() {
1441 - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', 'print_content()' );
772 + Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', __CLASS__ . '::print_content()' );
1442 773
1443 774 $this->print_content();
1444 775 }
1445 776
@@ -1494,11 +825,8 @@
1494 825
1495 826 /**
1496 827 * A Base method for sanitizing the settings before save.
1497 828 * This method is meant to be overridden by the element.
1498 - *
1499 - * @param array $settings
1500 - * @return array
1501 829 */
1502 830 protected function on_save( array $settings ) {
1503 831 return $settings;
1504 832 }
@@ -1517,9 +845,9 @@
1517 845 */
1518 846 private function get_child_type( $element_data ) {
1519 847 $child_type = $this->_get_default_child_type( $element_data );
1520 848
1521 - // If it's not a valid widget ( like a deactivated plugin ).
849 + // If it's not a valid widget ( like a deactivated plugin )
1522 850 if ( ! $child_type ) {
1523 851 return false;
1524 852 }
1525 853
@@ -1564,12 +892,8 @@
1564 892 $this->add_child( $child_data );
1565 893 }
1566 894 }
1567 895
1568 - public function has_widget_inner_wrapper(): bool {
1569 - return true;
1570 - }
1571 -
1572 896 /**
1573 897 * Element base constructor.
1574 898 *
1575 899 * Initializing the element base class using `$data` and `$args`.
@@ -1582,9 +906,9 @@
1582 906 *
1583 907 * @param array $data Optional. Element data. Default is an empty array.
1584 908 * @param array|null $args Optional. Element default arguments. Default is null.
1585 909 **/
1586 - public function __construct( array $data = [], ?array $args = null ) {
910 + public function __construct( array $data = [], array $args = null ) {
1587 911 if ( $data ) {
1588 912 $this->is_type_instance = false;
1589 913 } elseif ( $args ) {
1590 914 $this->default_args = $args;