| @@ -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. |
| @@ -295,22 +285,8 @@ | ||
| 295 | 285 | return true; |
| 296 | 286 | } |
| 297 | 287 | |
| 298 | 288 | /** |
| 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 | 289 | * Get child elements. |
| 314 | 290 | * |
| 315 | 291 | * Retrieve all the child elements of this element. |
| 316 | 292 | * |
| @@ -406,14 +382,15 @@ | ||
| 406 | 382 | * @since 2.8.0 |
| 407 | 383 | * @access public |
| 408 | 384 | * |
| 409 | 385 | * @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. | |
| 386 | + * @param array $url_control Array of link settings. | |
| 387 | + * @param bool $overwrite Optional. Whether to overwrite existing | |
| 388 | + * attribute. Default is false, not to overwrite. | |
| 413 | 389 | * |
| 414 | 390 | * @return Element_Base Current instance of the element. |
| 415 | 391 | */ |
| 392 | + | |
| 416 | 393 | public function add_link_attributes( $element, array $url_control, $overwrite = false ) { |
| 417 | 394 | $attributes = []; |
| 418 | 395 | |
| 419 | 396 | if ( ! empty( $url_control['url'] ) ) { |
| @@ -430,9 +407,9 @@ | ||
| 430 | 407 | $attributes['rel'] = 'nofollow'; |
| 431 | 408 | } |
| 432 | 409 | |
| 433 | 410 | if ( ! empty( $url_control['custom_attributes'] ) ) { |
| 434 | - // Custom URL attributes should come as a string of comma-delimited key|value pairs. | |
| 411 | + // Custom URL attributes should come as a string of comma-delimited key|value pairs | |
| 435 | 412 | $attributes = array_merge( $attributes, Utils::parse_custom_attributes( $url_control['custom_attributes'] ) ); |
| 436 | 413 | } |
| 437 | 414 | |
| 438 | 415 | if ( $attributes ) { |
| @@ -452,15 +429,8 @@ | ||
| 452 | 429 | */ |
| 453 | 430 | public function print_element() { |
| 454 | 431 | $element_type = $this->get_type(); |
| 455 | 432 | |
| 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 | 433 | /** |
| 464 | 434 | * Before frontend element render. |
| 465 | 435 | * |
| 466 | 436 | * Fires before Elementor element is rendered in the frontend. |
| @@ -523,10 +493,8 @@ | ||
| 523 | 493 | // PHPCS - The content has already been escaped by the `render` method. |
| 524 | 494 | echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 525 | 495 | $this->after_render(); |
| 526 | 496 | |
| 527 | - // TODO: Remove this in the future | |
| 528 | - // Since version 3.24.0 page scripts/styles are handled by `page_assets`. | |
| 529 | 497 | $this->enqueue_scripts(); |
| 530 | 498 | $this->enqueue_styles(); |
| 531 | 499 | } |
| 532 | 500 | |
| @@ -554,54 +522,8 @@ | ||
| 554 | 522 | */ |
| 555 | 523 | do_action( 'elementor/frontend/after_render', $this ); |
| 556 | 524 | } |
| 557 | 525 | |
| 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 | 526 | /** |
| 605 | 527 | * Get the element raw data. |
| 606 | 528 | * |
| 607 | 529 | * Retrieve the raw element data, including the id, type, settings, child |
| @@ -704,9 +626,9 @@ | ||
| 704 | 626 | * @param array|null $controls The available controls. |
| 705 | 627 | * |
| 706 | 628 | * @return array Element data. |
| 707 | 629 | */ |
| 708 | - public static function on_import_update_dynamic_content( array $config, array $data, $controls = null ): array { | |
| 630 | + public static function on_import_update_dynamic_content( array $config, array $data, $controls = null ) : array { | |
| 709 | 631 | $tags_manager = Plugin::$instance->dynamic_tags; |
| 710 | 632 | |
| 711 | 633 | if ( empty( $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ] ) ) { |
| 712 | 634 | return $config; |
| @@ -769,9 +691,8 @@ | ||
| 769 | 691 | 'elementor-element-' . $id, |
| 770 | 692 | ], |
| 771 | 693 | 'data-id' => $id, |
| 772 | 694 | 'data-element_type' => $this->get_type(), |
| 773 | - 'data-e-type' => $this->get_type(), | |
| 774 | 695 | ] ); |
| 775 | 696 | |
| 776 | 697 | $class_settings = []; |
| 777 | 698 | |
| @@ -796,15 +717,15 @@ | ||
| 796 | 717 | } |
| 797 | 718 | |
| 798 | 719 | $_animation = ! empty( $settings['_animation'] ); |
| 799 | 720 | $animation = ! empty( $settings['animation'] ); |
| 800 | - $has_animation = ( $_animation && 'none' !== $settings['_animation'] ) || ( $animation && 'none' !== $settings['animation'] ); | |
| 721 | + $has_animation = $_animation && 'none' !== $settings['_animation'] || $animation && 'none' !== $settings['animation']; | |
| 801 | 722 | |
| 802 | 723 | if ( $has_animation ) { |
| 803 | 724 | $is_static_render_mode = Plugin::$instance->frontend->is_static_render_mode(); |
| 804 | 725 | |
| 805 | 726 | if ( ! $is_static_render_mode ) { |
| 806 | - // Hide the element until the animation begins. | |
| 727 | + // Hide the element until the animation begins | |
| 807 | 728 | $this->add_render_attribute( '_wrapper', 'class', 'elementor-invisible' ); |
| 808 | 729 | } |
| 809 | 730 | } |
| 810 | 731 | |
| @@ -832,15 +753,13 @@ | ||
| 832 | 753 | * Register the Transform controls in the advanced tab of the element. |
| 833 | 754 | * |
| 834 | 755 | * Previously registered under the Widget_Common class, but registered a more fundamental level now to enable access from other widgets. |
| 835 | 756 | * |
| 836 | - * @param string $element_selector | |
| 837 | - * @param string $transform_selector_class | |
| 838 | - * @return void | |
| 839 | 757 | * @since 3.9.0 |
| 840 | 758 | * @access protected |
| 759 | + * @return void | |
| 841 | 760 | */ |
| 842 | - protected function register_transform_section( $element_selector = '', $transform_selector_class = ' > .elementor-widget-container' ) { | |
| 761 | + protected function register_transform_section( $element_selector = '' ) { | |
| 843 | 762 | $default_unit_values_deg = []; |
| 844 | 763 | $default_unit_values_ms = []; |
| 845 | 764 | |
| 846 | 765 | // Set the default unit sizes for all active breakpoints. |
| @@ -869,8 +788,9 @@ | ||
| 869 | 788 | $this->start_controls_tabs( '_tabs_positioning' ); |
| 870 | 789 | |
| 871 | 790 | $transform_prefix_class = 'e-'; |
| 872 | 791 | $transform_return_value = 'transform'; |
| 792 | + $transform_selector_class = ' > .elementor-widget-container'; | |
| 873 | 793 | $transform_css_modifier = ''; |
| 874 | 794 | |
| 875 | 795 | if ( 'con' === $element_selector ) { |
| 876 | 796 | $transform_selector_class = '.e-' . $element_selector; |
| @@ -933,9 +853,8 @@ | ||
| 933 | 853 | ], |
| 934 | 854 | 'condition' => [ |
| 935 | 855 | "_transform_rotate_popover{$tab}!" => '', |
| 936 | 856 | ], |
| 937 | - 'frontend_available' => true, | |
| 938 | 857 | ] |
| 939 | 858 | ); |
| 940 | 859 | |
| 941 | 860 | $this->add_responsive_control( |
| @@ -1313,9 +1232,9 @@ | ||
| 1313 | 1232 | 'relation' => 'or', |
| 1314 | 1233 | 'terms' => array_merge( $transform_origin_conditions, $transform_origin_conditions_hover ), |
| 1315 | 1234 | ]; |
| 1316 | 1235 | |
| 1317 | - // Will override motion effect transform-origin. | |
| 1236 | + // Will override motion effect transform-origin | |
| 1318 | 1237 | $this->add_responsive_control( |
| 1319 | 1238 | 'motion_fx_transform_x_anchor_point', |
| 1320 | 1239 | [ |
| 1321 | 1240 | 'label' => esc_html__( 'X Anchor Point', 'elementor' ), |
| @@ -1341,9 +1260,9 @@ | ||
| 1341 | 1260 | ], |
| 1342 | 1261 | ] |
| 1343 | 1262 | ); |
| 1344 | 1263 | |
| 1345 | - // Will override motion effect transform-origin. | |
| 1264 | + // Will override motion effect transform-origin | |
| 1346 | 1265 | $this->add_responsive_control( |
| 1347 | 1266 | 'motion_fx_transform_y_anchor_point', |
| 1348 | 1267 | [ |
| 1349 | 1268 | 'label' => esc_html__( 'Y Anchor Point', 'elementor' ), |
| @@ -1494,11 +1413,8 @@ | ||
| 1494 | 1413 | |
| 1495 | 1414 | /** |
| 1496 | 1415 | * A Base method for sanitizing the settings before save. |
| 1497 | 1416 | * This method is meant to be overridden by the element. |
| 1498 | - * | |
| 1499 | - * @param array $settings | |
| 1500 | - * @return array | |
| 1501 | 1417 | */ |
| 1502 | 1418 | protected function on_save( array $settings ) { |
| 1503 | 1419 | return $settings; |
| 1504 | 1420 | } |
| @@ -1517,9 +1433,9 @@ | ||
| 1517 | 1433 | */ |
| 1518 | 1434 | private function get_child_type( $element_data ) { |
| 1519 | 1435 | $child_type = $this->_get_default_child_type( $element_data ); |
| 1520 | 1436 | |
| 1521 | - // If it's not a valid widget ( like a deactivated plugin ). | |
| 1437 | + // If it's not a valid widget ( like a deactivated plugin ) | |
| 1522 | 1438 | if ( ! $child_type ) { |
| 1523 | 1439 | return false; |
| 1524 | 1440 | } |
| 1525 | 1441 | |
| @@ -1564,12 +1480,8 @@ | ||
| 1564 | 1480 | $this->add_child( $child_data ); |
| 1565 | 1481 | } |
| 1566 | 1482 | } |
| 1567 | 1483 | |
| 1568 | - public function has_widget_inner_wrapper(): bool { | |
| 1569 | - return true; | |
| 1570 | - } | |
| 1571 | - | |
| 1572 | 1484 | /** |
| 1573 | 1485 | * Element base constructor. |
| 1574 | 1486 | * |
| 1575 | 1487 | * Initializing the element base class using `$data` and `$args`. |
| @@ -1582,9 +1494,9 @@ | ||
| 1582 | 1494 | * |
| 1583 | 1495 | * @param array $data Optional. Element data. Default is an empty array. |
| 1584 | 1496 | * @param array|null $args Optional. Element default arguments. Default is null. |
| 1585 | 1497 | **/ |
| 1586 | - public function __construct( array $data = [], ?array $args = null ) { | |
| 1498 | + public function __construct( array $data = [], array $args = null ) { | |
| 1587 | 1499 | if ( $data ) { |
| 1588 | 1500 | $this->is_type_instance = false; |
| 1589 | 1501 | } elseif ( $args ) { |
| 1590 | 1502 | $this->default_args = $args; |