| @@ -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,12 @@ | ||
| 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 | + 'jquery-slick' => [ | |
| 133 | + 'version' => '2.7.0', | |
| 134 | + 'replacement' => 'Swiper', | |
| 135 | + ], | |
| 139 | 136 | ]; |
| 140 | 137 | |
| 141 | 138 | foreach ( $this->get_script_depends() as $script ) { |
| 142 | 139 | if ( isset( $deprecated_scripts[ $script ] ) ) { |
| @@ -144,16 +141,10 @@ | ||
| 144 | 141 | } |
| 145 | 142 | |
| 146 | 143 | wp_enqueue_script( $script ); |
| 147 | 144 | } |
| 148 | - | |
| 149 | - foreach ( $this->get_global_scripts() as $script ) { | |
| 150 | - wp_enqueue_script( $script ); | |
| 151 | - } | |
| 152 | 145 | } |
| 153 | 146 | |
| 154 | - public function register_frontend_handlers() {} | |
| 155 | - | |
| 156 | 147 | /** |
| 157 | 148 | * Get style dependencies. |
| 158 | 149 | * |
| 159 | 150 | * Retrieve the list of style dependencies the element requires. |
| @@ -295,22 +286,8 @@ | ||
| 295 | 286 | return true; |
| 296 | 287 | } |
| 297 | 288 | |
| 298 | 289 | /** |
| 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 | 290 | * Get child elements. |
| 314 | 291 | * |
| 315 | 292 | * Retrieve all the child elements of this element. |
| 316 | 293 | * |
| @@ -344,23 +321,8 @@ | ||
| 344 | 321 | return self::get_items( $this->default_args, $item ); |
| 345 | 322 | } |
| 346 | 323 | |
| 347 | 324 | /** |
| 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 | 325 | * Add new child element. |
| 364 | 326 | * |
| 365 | 327 | * Register new child element to allow hierarchy. |
| 366 | 328 | * |
| @@ -406,14 +368,15 @@ | ||
| 406 | 368 | * @since 2.8.0 |
| 407 | 369 | * @access public |
| 408 | 370 | * |
| 409 | 371 | * @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. | |
| 372 | + * @param array $url_control Array of link settings. | |
| 373 | + * @param bool $overwrite Optional. Whether to overwrite existing | |
| 374 | + * attribute. Default is false, not to overwrite. | |
| 413 | 375 | * |
| 414 | 376 | * @return Element_Base Current instance of the element. |
| 415 | 377 | */ |
| 378 | + | |
| 416 | 379 | public function add_link_attributes( $element, array $url_control, $overwrite = false ) { |
| 417 | 380 | $attributes = []; |
| 418 | 381 | |
| 419 | 382 | if ( ! empty( $url_control['url'] ) ) { |
| @@ -430,14 +393,14 @@ | ||
| 430 | 393 | $attributes['rel'] = 'nofollow'; |
| 431 | 394 | } |
| 432 | 395 | |
| 433 | 396 | if ( ! empty( $url_control['custom_attributes'] ) ) { |
| 434 | - // Custom URL attributes should come as a string of comma-delimited key|value pairs. | |
| 397 | + // Custom URL attributes should come as a string of comma-delimited key|value pairs | |
| 435 | 398 | $attributes = array_merge( $attributes, Utils::parse_custom_attributes( $url_control['custom_attributes'] ) ); |
| 436 | 399 | } |
| 437 | 400 | |
| 438 | 401 | if ( $attributes ) { |
| 439 | - $this->add_render_attribute( $element, $attributes, null, $overwrite ); | |
| 402 | + $this->add_render_attribute( $element, $attributes, $overwrite ); | |
| 440 | 403 | } |
| 441 | 404 | |
| 442 | 405 | return $this; |
| 443 | 406 | } |
| @@ -452,15 +415,8 @@ | ||
| 452 | 415 | */ |
| 453 | 416 | public function print_element() { |
| 454 | 417 | $element_type = $this->get_type(); |
| 455 | 418 | |
| 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 | 419 | /** |
| 464 | 420 | * Before frontend element render. |
| 465 | 421 | * |
| 466 | 422 | * Fires before Elementor element is rendered in the frontend. |
| @@ -523,10 +479,8 @@ | ||
| 523 | 479 | // PHPCS - The content has already been escaped by the `render` method. |
| 524 | 480 | echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 525 | 481 | $this->after_render(); |
| 526 | 482 | |
| 527 | - // TODO: Remove this in the future | |
| 528 | - // Since version 3.24.0 page scripts/styles are handled by `page_assets`. | |
| 529 | 483 | $this->enqueue_scripts(); |
| 530 | 484 | $this->enqueue_styles(); |
| 531 | 485 | } |
| 532 | 486 | |
| @@ -554,54 +508,8 @@ | ||
| 554 | 508 | */ |
| 555 | 509 | do_action( 'elementor/frontend/after_render', $this ); |
| 556 | 510 | } |
| 557 | 511 | |
| 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 | 512 | /** |
| 605 | 513 | * Get the element raw data. |
| 606 | 514 | * |
| 607 | 515 | * Retrieve the raw element data, including the id, type, settings, child |
| @@ -628,9 +536,9 @@ | ||
| 628 | 536 | foreach ( $this->get_children() as $child ) { |
| 629 | 537 | $elements[] = $child->get_raw_data( $with_html_content ); |
| 630 | 538 | } |
| 631 | 539 | |
| 632 | - $raw_data = [ | |
| 540 | + return [ | |
| 633 | 541 | 'id' => $this->get_id(), |
| 634 | 542 | 'elType' => $data['elType'], |
| 635 | 543 | 'settings' => $data['settings'], |
| 636 | 544 | 'elements' => $elements, |
| @@ -635,36 +543,10 @@ | ||
| 635 | 543 | 'settings' => $data['settings'], |
| 636 | 544 | 'elements' => $elements, |
| 637 | 545 | 'isInner' => $data['isInner'], |
| 638 | 546 | ]; |
| 639 | - | |
| 640 | - if ( ! empty( $data['isLocked'] ) ) { | |
| 641 | - $raw_data['isLocked'] = $data['isLocked']; | |
| 642 | - } | |
| 643 | - | |
| 644 | - return $raw_data; | |
| 645 | 547 | } |
| 646 | 548 | |
| 647 | - public function get_data_for_save() { | |
| 648 | - $data = $this->get_raw_data(); | |
| 649 | - | |
| 650 | - $elements = []; | |
| 651 | - | |
| 652 | - foreach ( $this->get_children() as $child ) { | |
| 653 | - $elements[] = $child->get_data_for_save(); | |
| 654 | - } | |
| 655 | - | |
| 656 | - if ( ! empty( $elements ) ) { | |
| 657 | - $data['elements'] = $elements; | |
| 658 | - } | |
| 659 | - | |
| 660 | - if ( ! empty( $data['settings'] ) ) { | |
| 661 | - $data['settings'] = $this->on_save( $data['settings'] ); | |
| 662 | - } | |
| 663 | - | |
| 664 | - return $data; | |
| 665 | - } | |
| 666 | - | |
| 667 | 549 | /** |
| 668 | 550 | * Get unique selector. |
| 669 | 551 | * |
| 670 | 552 | * Retrieve the unique selector of the element. Used to set a unique HTML |
| @@ -694,47 +576,8 @@ | ||
| 694 | 576 | return $this->is_type_instance; |
| 695 | 577 | } |
| 696 | 578 | |
| 697 | 579 | /** |
| 698 | - * On import update dynamic content (e.g. post and term IDs). | |
| 699 | - * | |
| 700 | - * @since 3.8.0 | |
| 701 | - * | |
| 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 | - * @return array Element data. | |
| 707 | - */ | |
| 708 | - public static function on_import_update_dynamic_content( array $config, array $data, $controls = null ): array { | |
| 709 | - $tags_manager = Plugin::$instance->dynamic_tags; | |
| 710 | - | |
| 711 | - if ( empty( $config['settings'][ $tags_manager::DYNAMIC_SETTING_KEY ] ) ) { | |
| 712 | - return $config; | |
| 713 | - } | |
| 714 | - | |
| 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; | |
| 721 | - } | |
| 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 | - } | |
| 732 | - | |
| 733 | - return $config; | |
| 734 | - } | |
| 735 | - | |
| 736 | - /** | |
| 737 | 580 | * Add render attributes. |
| 738 | 581 | * |
| 739 | 582 | * Used to add attributes to the current element wrapper HTML tag. |
| 740 | 583 | * |
| @@ -739,12 +582,12 @@ | ||
| 739 | 582 | * Used to add attributes to the current element wrapper HTML tag. |
| 740 | 583 | * |
| 741 | 584 | * @since 1.3.0 |
| 742 | 585 | * @access protected |
| 743 | - * @deprecated 3.1.0 Use `add_render_attribute()` method instead. | |
| 586 | + * @deprecated 3.1.0 | |
| 744 | 587 | */ |
| 745 | 588 | protected function _add_render_attributes() { |
| 746 | - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', 'add_render_attributes()' ); | |
| 589 | + Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', __CLASS__ . '::add_render_attributes()' ); | |
| 747 | 590 | |
| 748 | 591 | return $this->add_render_attributes(); |
| 749 | 592 | } |
| 750 | 593 | |
| @@ -769,9 +612,8 @@ | ||
| 769 | 612 | 'elementor-element-' . $id, |
| 770 | 613 | ], |
| 771 | 614 | 'data-id' => $id, |
| 772 | 615 | 'data-element_type' => $this->get_type(), |
| 773 | - 'data-e-type' => $this->get_type(), | |
| 774 | 616 | ] ); |
| 775 | 617 | |
| 776 | 618 | $class_settings = []; |
| 777 | 619 | |
| @@ -776,15 +618,9 @@ | ||
| 776 | 618 | $class_settings = []; |
| 777 | 619 | |
| 778 | 620 | foreach ( $settings as $setting_key => $setting ) { |
| 779 | 621 | 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; | |
| 622 | + $class_settings[ $setting_key ] = $setting; | |
| 787 | 623 | } |
| 788 | 624 | } |
| 789 | 625 | |
| 790 | 626 | foreach ( $class_settings as $setting_key => $setting ) { |
| @@ -796,15 +632,15 @@ | ||
| 796 | 632 | } |
| 797 | 633 | |
| 798 | 634 | $_animation = ! empty( $settings['_animation'] ); |
| 799 | 635 | $animation = ! empty( $settings['animation'] ); |
| 800 | - $has_animation = ( $_animation && 'none' !== $settings['_animation'] ) || ( $animation && 'none' !== $settings['animation'] ); | |
| 636 | + $has_animation = $_animation && 'none' !== $settings['_animation'] || $animation && 'none' !== $settings['animation']; | |
| 801 | 637 | |
| 802 | 638 | if ( $has_animation ) { |
| 803 | 639 | $is_static_render_mode = Plugin::$instance->frontend->is_static_render_mode(); |
| 804 | 640 | |
| 805 | 641 | if ( ! $is_static_render_mode ) { |
| 806 | - // Hide the element until the animation begins. | |
| 642 | + // Hide the element until the animation begins | |
| 807 | 643 | $this->add_render_attribute( '_wrapper', 'class', 'elementor-invisible' ); |
| 808 | 644 | } |
| 809 | 645 | } |
| 810 | 646 | |
| @@ -828,552 +664,8 @@ | ||
| 828 | 664 | do_action( 'elementor/element/after_add_attributes', $this ); |
| 829 | 665 | } |
| 830 | 666 | |
| 831 | 667 | /** |
| 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 | 668 | * Add Hidden Device Controls |
| 1377 | 669 | * |
| 1378 | 670 | * Adds controls for hiding elements within certain devices' viewport widths. Adds a control for each active device. |
| 1379 | 671 | * |
| @@ -1385,23 +677,20 @@ | ||
| 1385 | 677 | $active_devices = Plugin::$instance->breakpoints->get_active_devices_list( [ 'reverse' => true ] ); |
| 1386 | 678 | $active_breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints(); |
| 1387 | 679 | |
| 1388 | 680 | foreach ( $active_devices as $breakpoint_key ) { |
| 1389 | - $label = 'desktop' === $breakpoint_key ? esc_html__( 'Desktop', 'elementor' ) : $active_breakpoints[ $breakpoint_key ]->get_label(); | |
| 681 | + $label = 'desktop' === $breakpoint_key ? __( 'Desktop', 'elementor' ) : $active_breakpoints[ $breakpoint_key ]->get_label(); | |
| 1390 | 682 | |
| 1391 | 683 | $this->add_control( |
| 1392 | 684 | 'hide_' . $breakpoint_key, |
| 1393 | 685 | [ |
| 1394 | - 'label' => sprintf( | |
| 1395 | - /* translators: %s: Device name. */ | |
| 1396 | - esc_html__( 'Hide On %s', 'elementor' ), | |
| 1397 | - $label | |
| 1398 | - ), | |
| 686 | + /* translators: %s: Device name. */ | |
| 687 | + 'label' => sprintf( __( 'Hide On %s', 'elementor' ), $label ), | |
| 1399 | 688 | 'type' => Controls_Manager::SWITCHER, |
| 1400 | 689 | 'default' => '', |
| 1401 | 690 | 'prefix_class' => 'elementor-', |
| 1402 | - 'label_on' => esc_html__( 'Hide', 'elementor' ), | |
| 1403 | - 'label_off' => esc_html__( 'Show', 'elementor' ), | |
| 691 | + 'label_on' => 'Hide', | |
| 692 | + 'label_off' => 'Show', | |
| 1404 | 693 | 'return_value' => 'hidden-' . $breakpoint_key, |
| 1405 | 694 | ] |
| 1406 | 695 | ); |
| 1407 | 696 | } |
| @@ -1434,12 +723,11 @@ | ||
| 1434 | 723 | * Output the element final HTML on the frontend. |
| 1435 | 724 | * |
| 1436 | 725 | * @since 1.0.0 |
| 1437 | 726 | * @access protected |
| 1438 | - * @deprecated 3.1.0 Use `print_content()` method instead. | |
| 1439 | 727 | */ |
| 1440 | 728 | protected function _print_content() { |
| 1441 | - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', 'print_content()' ); | |
| 729 | + Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', __CLASS__ . '::print_content()' ); | |
| 1442 | 730 | |
| 1443 | 731 | $this->print_content(); |
| 1444 | 732 | } |
| 1445 | 733 | |
| @@ -1492,19 +780,8 @@ | ||
| 1492 | 780 | return $config; |
| 1493 | 781 | } |
| 1494 | 782 | |
| 1495 | 783 | /** |
| 1496 | - * A Base method for sanitizing the settings before save. | |
| 1497 | - * This method is meant to be overridden by the element. | |
| 1498 | - * | |
| 1499 | - * @param array $settings | |
| 1500 | - * @return array | |
| 1501 | - */ | |
| 1502 | - protected function on_save( array $settings ) { | |
| 1503 | - return $settings; | |
| 1504 | - } | |
| 1505 | - | |
| 1506 | - /** | |
| 1507 | 784 | * Get child type. |
| 1508 | 785 | * |
| 1509 | 786 | * Retrieve the element child type based on element data. |
| 1510 | 787 | * |
| @@ -1517,9 +794,9 @@ | ||
| 1517 | 794 | */ |
| 1518 | 795 | private function get_child_type( $element_data ) { |
| 1519 | 796 | $child_type = $this->_get_default_child_type( $element_data ); |
| 1520 | 797 | |
| 1521 | - // If it's not a valid widget ( like a deactivated plugin ). | |
| 798 | + // If it's not a valid widget ( like a deactivated plugin ) | |
| 1522 | 799 | if ( ! $child_type ) { |
| 1523 | 800 | return false; |
| 1524 | 801 | } |
| 1525 | 802 | |
| @@ -1564,12 +841,8 @@ | ||
| 1564 | 841 | $this->add_child( $child_data ); |
| 1565 | 842 | } |
| 1566 | 843 | } |
| 1567 | 844 | |
| 1568 | - public function has_widget_inner_wrapper(): bool { | |
| 1569 | - return true; | |
| 1570 | - } | |
| 1571 | - | |
| 1572 | 845 | /** |
| 1573 | 846 | * Element base constructor. |
| 1574 | 847 | * |
| 1575 | 848 | * Initializing the element base class using `$data` and `$args`. |
| @@ -1582,9 +855,9 @@ | ||
| 1582 | 855 | * |
| 1583 | 856 | * @param array $data Optional. Element data. Default is an empty array. |
| 1584 | 857 | * @param array|null $args Optional. Element default arguments. Default is null. |
| 1585 | 858 | **/ |
| 1586 | - public function __construct( array $data = [], ?array $args = null ) { | |
| 859 | + public function __construct( array $data = [], array $args = null ) { | |
| 1587 | 860 | if ( $data ) { |
| 1588 | 861 | $this->is_type_instance = false; |
| 1589 | 862 | } elseif ( $args ) { |
| 1590 | 863 | $this->default_args = $args; |