| @@ -119,12 +119,8 @@ | ||
| 119 | 119 | public function get_script_depends() { |
| 120 | 120 | return $this->depended_scripts; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - public function get_global_scripts() { | |
| 124 | - return [ 'elementor-frontend' ]; | |
| 125 | - } | |
| 126 | - | |
| 127 | 123 | /** |
| 128 | 124 | * Enqueue scripts. |
| 129 | 125 | * |
| 130 | 126 | * Registers all the scripts defined as element dependencies and enqueues |
| @@ -134,9 +130,9 @@ | ||
| 134 | 130 | * @access public |
| 135 | 131 | */ |
| 136 | 132 | final public function enqueue_scripts() { |
| 137 | 133 | $deprecated_scripts = [ |
| 138 | - // Insert here when you have a deprecated script. | |
| 134 | + //Insert here when you have a deprecated script | |
| 139 | 135 | ]; |
| 140 | 136 | |
| 141 | 137 | foreach ( $this->get_script_depends() as $script ) { |
| 142 | 138 | if ( isset( $deprecated_scripts[ $script ] ) ) { |
| @@ -144,16 +140,10 @@ | ||
| 144 | 140 | } |
| 145 | 141 | |
| 146 | 142 | wp_enqueue_script( $script ); |
| 147 | 143 | } |
| 148 | - | |
| 149 | - foreach ( $this->get_global_scripts() as $script ) { | |
| 150 | - wp_enqueue_script( $script ); | |
| 151 | - } | |
| 152 | 144 | } |
| 153 | 145 | |
| 154 | - public function register_frontend_handlers() {} | |
| 155 | - | |
| 156 | 146 | /** |
| 157 | 147 | * Get style dependencies. |
| 158 | 148 | * |
| 159 | 149 | * Retrieve the list of style dependencies the element requires. |
| @@ -297,9 +287,9 @@ | ||
| 297 | 287 | |
| 298 | 288 | /** |
| 299 | 289 | * Whether the element returns dynamic content. |
| 300 | 290 | * |
| 301 | - * Set to determine whether to cache the element output or not. | |
| 291 | + * set to determine whether to cache the element output or not. | |
| 302 | 292 | * |
| 303 | 293 | * @since 3.22.0 |
| 304 | 294 | * @access protected |
| 305 | 295 | * |
| @@ -406,14 +396,15 @@ | ||
| 406 | 396 | * @since 2.8.0 |
| 407 | 397 | * @access public |
| 408 | 398 | * |
| 409 | 399 | * @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. | |
| 400 | + * @param array $url_control Array of link settings. | |
| 401 | + * @param bool $overwrite Optional. Whether to overwrite existing | |
| 402 | + * attribute. Default is false, not to overwrite. | |
| 413 | 403 | * |
| 414 | 404 | * @return Element_Base Current instance of the element. |
| 415 | 405 | */ |
| 406 | + | |
| 416 | 407 | public function add_link_attributes( $element, array $url_control, $overwrite = false ) { |
| 417 | 408 | $attributes = []; |
| 418 | 409 | |
| 419 | 410 | if ( ! empty( $url_control['url'] ) ) { |
| @@ -430,9 +421,9 @@ | ||
| 430 | 421 | $attributes['rel'] = 'nofollow'; |
| 431 | 422 | } |
| 432 | 423 | |
| 433 | 424 | if ( ! empty( $url_control['custom_attributes'] ) ) { |
| 434 | - // Custom URL attributes should come as a string of comma-delimited key|value pairs. | |
| 425 | + // Custom URL attributes should come as a string of comma-delimited key|value pairs | |
| 435 | 426 | $attributes = array_merge( $attributes, Utils::parse_custom_attributes( $url_control['custom_attributes'] ) ); |
| 436 | 427 | } |
| 437 | 428 | |
| 438 | 429 | if ( $attributes ) { |
| @@ -453,11 +444,9 @@ | ||
| 453 | 444 | public function print_element() { |
| 454 | 445 | $element_type = $this->get_type(); |
| 455 | 446 | |
| 456 | 447 | 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() ) ) ) . '"]'; | |
| 448 | + echo '[elementor-element data="' . esc_attr( base64_encode( wp_json_encode( $this->get_raw_data() ) ) ) . '"]'; | |
| 460 | 449 | return; |
| 461 | 450 | } |
| 462 | 451 | |
| 463 | 452 | /** |
| @@ -704,9 +693,9 @@ | ||
| 704 | 693 | * @param array|null $controls The available controls. |
| 705 | 694 | * |
| 706 | 695 | * @return array Element data. |
| 707 | 696 | */ |
| 708 | - public static function on_import_update_dynamic_content( array $config, array $data, $controls = null ): array { | |
| 697 | + public static function on_import_update_dynamic_content( array $config, array $data, $controls = null ) : array { | |
| 709 | 698 | $tags_manager = Plugin::$instance->dynamic_tags; |
| 710 | 699 | |
| 711 | 700 | if ( empty( $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ] ) ) { |
| 712 | 701 | return $config; |
| @@ -769,9 +758,8 @@ | ||
| 769 | 758 | 'elementor-element-' . $id, |
| 770 | 759 | ], |
| 771 | 760 | 'data-id' => $id, |
| 772 | 761 | 'data-element_type' => $this->get_type(), |
| 773 | - 'data-e-type' => $this->get_type(), | |
| 774 | 762 | ] ); |
| 775 | 763 | |
| 776 | 764 | $class_settings = []; |
| 777 | 765 | |
| @@ -796,15 +784,15 @@ | ||
| 796 | 784 | } |
| 797 | 785 | |
| 798 | 786 | $_animation = ! empty( $settings['_animation'] ); |
| 799 | 787 | $animation = ! empty( $settings['animation'] ); |
| 800 | - $has_animation = ( $_animation && 'none' !== $settings['_animation'] ) || ( $animation && 'none' !== $settings['animation'] ); | |
| 788 | + $has_animation = $_animation && 'none' !== $settings['_animation'] || $animation && 'none' !== $settings['animation']; | |
| 801 | 789 | |
| 802 | 790 | if ( $has_animation ) { |
| 803 | 791 | $is_static_render_mode = Plugin::$instance->frontend->is_static_render_mode(); |
| 804 | 792 | |
| 805 | 793 | if ( ! $is_static_render_mode ) { |
| 806 | - // Hide the element until the animation begins. | |
| 794 | + // Hide the element until the animation begins | |
| 807 | 795 | $this->add_render_attribute( '_wrapper', 'class', 'elementor-invisible' ); |
| 808 | 796 | } |
| 809 | 797 | } |
| 810 | 798 | |
| @@ -832,15 +820,13 @@ | ||
| 832 | 820 | * Register the Transform controls in the advanced tab of the element. |
| 833 | 821 | * |
| 834 | 822 | * Previously registered under the Widget_Common class, but registered a more fundamental level now to enable access from other widgets. |
| 835 | 823 | * |
| 836 | - * @param string $element_selector | |
| 837 | - * @param string $transform_selector_class | |
| 838 | - * @return void | |
| 839 | 824 | * @since 3.9.0 |
| 840 | 825 | * @access protected |
| 826 | + * @return void | |
| 841 | 827 | */ |
| 842 | - protected function register_transform_section( $element_selector = '', $transform_selector_class = ' > .elementor-widget-container' ) { | |
| 828 | + protected function register_transform_section( $element_selector = '' ) { | |
| 843 | 829 | $default_unit_values_deg = []; |
| 844 | 830 | $default_unit_values_ms = []; |
| 845 | 831 | |
| 846 | 832 | // Set the default unit sizes for all active breakpoints. |
| @@ -869,8 +855,9 @@ | ||
| 869 | 855 | $this->start_controls_tabs( '_tabs_positioning' ); |
| 870 | 856 | |
| 871 | 857 | $transform_prefix_class = 'e-'; |
| 872 | 858 | $transform_return_value = 'transform'; |
| 859 | + $transform_selector_class = ' > .elementor-widget-container'; | |
| 873 | 860 | $transform_css_modifier = ''; |
| 874 | 861 | |
| 875 | 862 | if ( 'con' === $element_selector ) { |
| 876 | 863 | $transform_selector_class = '.e-' . $element_selector; |
| @@ -933,9 +920,8 @@ | ||
| 933 | 920 | ], |
| 934 | 921 | 'condition' => [ |
| 935 | 922 | "_transform_rotate_popover{$tab}!" => '', |
| 936 | 923 | ], |
| 937 | - 'frontend_available' => true, | |
| 938 | 924 | ] |
| 939 | 925 | ); |
| 940 | 926 | |
| 941 | 927 | $this->add_responsive_control( |
| @@ -1313,9 +1299,9 @@ | ||
| 1313 | 1299 | 'relation' => 'or', |
| 1314 | 1300 | 'terms' => array_merge( $transform_origin_conditions, $transform_origin_conditions_hover ), |
| 1315 | 1301 | ]; |
| 1316 | 1302 | |
| 1317 | - // Will override motion effect transform-origin. | |
| 1303 | + // Will override motion effect transform-origin | |
| 1318 | 1304 | $this->add_responsive_control( |
| 1319 | 1305 | 'motion_fx_transform_x_anchor_point', |
| 1320 | 1306 | [ |
| 1321 | 1307 | 'label' => esc_html__( 'X Anchor Point', 'elementor' ), |
| @@ -1341,9 +1327,9 @@ | ||
| 1341 | 1327 | ], |
| 1342 | 1328 | ] |
| 1343 | 1329 | ); |
| 1344 | 1330 | |
| 1345 | - // Will override motion effect transform-origin. | |
| 1331 | + // Will override motion effect transform-origin | |
| 1346 | 1332 | $this->add_responsive_control( |
| 1347 | 1333 | 'motion_fx_transform_y_anchor_point', |
| 1348 | 1334 | [ |
| 1349 | 1335 | 'label' => esc_html__( 'Y Anchor Point', 'elementor' ), |
| @@ -1494,11 +1480,8 @@ | ||
| 1494 | 1480 | |
| 1495 | 1481 | /** |
| 1496 | 1482 | * A Base method for sanitizing the settings before save. |
| 1497 | 1483 | * This method is meant to be overridden by the element. |
| 1498 | - * | |
| 1499 | - * @param array $settings | |
| 1500 | - * @return array | |
| 1501 | 1484 | */ |
| 1502 | 1485 | protected function on_save( array $settings ) { |
| 1503 | 1486 | return $settings; |
| 1504 | 1487 | } |
| @@ -1517,9 +1500,9 @@ | ||
| 1517 | 1500 | */ |
| 1518 | 1501 | private function get_child_type( $element_data ) { |
| 1519 | 1502 | $child_type = $this->_get_default_child_type( $element_data ); |
| 1520 | 1503 | |
| 1521 | - // If it's not a valid widget ( like a deactivated plugin ). | |
| 1504 | + // If it's not a valid widget ( like a deactivated plugin ) | |
| 1522 | 1505 | if ( ! $child_type ) { |
| 1523 | 1506 | return false; |
| 1524 | 1507 | } |
| 1525 | 1508 | |
| @@ -1564,12 +1547,8 @@ | ||
| 1564 | 1547 | $this->add_child( $child_data ); |
| 1565 | 1548 | } |
| 1566 | 1549 | } |
| 1567 | 1550 | |
| 1568 | - public function has_widget_inner_wrapper(): bool { | |
| 1569 | - return true; | |
| 1570 | - } | |
| 1571 | - | |
| 1572 | 1551 | /** |
| 1573 | 1552 | * Element base constructor. |
| 1574 | 1553 | * |
| 1575 | 1554 | * Initializing the element base class using `$data` and `$args`. |
| @@ -1582,9 +1561,9 @@ | ||
| 1582 | 1561 | * |
| 1583 | 1562 | * @param array $data Optional. Element data. Default is an empty array. |
| 1584 | 1563 | * @param array|null $args Optional. Element default arguments. Default is null. |
| 1585 | 1564 | **/ |
| 1586 | - public function __construct( array $data = [], ?array $args = null ) { | |
| 1565 | + public function __construct( array $data = [], array $args = null ) { | |
| 1587 | 1566 | if ( $data ) { |
| 1588 | 1567 | $this->is_type_instance = false; |
| 1589 | 1568 | } elseif ( $args ) { |
| 1590 | 1569 | $this->default_args = $args; |