| @@ -89,30 +89,8 @@ | ||
| 89 | 89 | public function get_keywords() { |
| 90 | 90 | return [ 'divider', 'hr', 'line', 'border' ]; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - protected function is_dynamic_content(): bool { | |
| 94 | - return false; | |
| 95 | - } | |
| 96 | - | |
| 97 | - public function has_widget_inner_wrapper(): bool { | |
| 98 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 99 | - } | |
| 100 | - | |
| 101 | - /** | |
| 102 | - * Get style dependencies. | |
| 103 | - * | |
| 104 | - * Retrieve the list of style dependencies the widget requires. | |
| 105 | - * | |
| 106 | - * @since 3.24.0 | |
| 107 | - * @access public | |
| 108 | - * | |
| 109 | - * @return array Widget style dependencies. | |
| 110 | - */ | |
| 111 | - public function get_style_depends(): array { | |
| 112 | - return [ 'widget-divider' ]; | |
| 113 | - } | |
| 114 | - | |
| 115 | 93 | private static function get_additional_styles() { |
| 116 | 94 | static $additional_styles = null; |
| 117 | 95 | |
| 118 | 96 | if ( null !== $additional_styles ) { |
| @@ -327,10 +305,10 @@ | ||
| 327 | 305 | ] |
| 328 | 306 | ); |
| 329 | 307 | } |
| 330 | 308 | |
| 331 | - private function filter_styles_by( $styles_array, $key, $value ) { | |
| 332 | - return array_filter( $styles_array, function( $style ) use ( $key, $value ) { | |
| 309 | + private function filter_styles_by( $array, $key, $value ) { | |
| 310 | + return array_filter( $array, function( $style ) use ( $key, $value ) { | |
| 333 | 311 | return $value === $style[ $key ]; |
| 334 | 312 | } ); |
| 335 | 313 | } |
| 336 | 314 | |
| @@ -517,8 +495,17 @@ | ||
| 517 | 495 | ] |
| 518 | 496 | ); |
| 519 | 497 | |
| 520 | 498 | $this->add_control( |
| 499 | + 'view', | |
| 500 | + [ | |
| 501 | + 'label' => esc_html__( 'View', 'elementor' ), | |
| 502 | + 'type' => Controls_Manager::HIDDEN, | |
| 503 | + 'default' => 'traditional', | |
| 504 | + ] | |
| 505 | + ); | |
| 506 | + | |
| 507 | + $this->add_control( | |
| 521 | 508 | 'text', |
| 522 | 509 | [ |
| 523 | 510 | 'label' => esc_html__( 'Text', 'elementor' ), |
| 524 | 511 | 'type' => Controls_Manager::TEXT, |
| @@ -603,9 +590,8 @@ | ||
| 603 | 590 | 'weight', |
| 604 | 591 | [ |
| 605 | 592 | 'label' => esc_html__( 'Weight', 'elementor' ), |
| 606 | 593 | 'type' => Controls_Manager::SLIDER, |
| 607 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 608 | 594 | 'default' => [ |
| 609 | 595 | 'size' => 1, |
| 610 | 596 | ], |
| 611 | 597 | 'range' => [ |
| @@ -613,16 +599,8 @@ | ||
| 613 | 599 | 'min' => 1, |
| 614 | 600 | 'max' => 10, |
| 615 | 601 | 'step' => 0.1, |
| 616 | 602 | ], |
| 617 | - 'em' => [ | |
| 618 | - 'min' => 0.1, | |
| 619 | - 'max' => 1, | |
| 620 | - ], | |
| 621 | - 'rem' => [ | |
| 622 | - 'min' => 0.1, | |
| 623 | - 'max' => 1, | |
| 624 | - ], | |
| 625 | 603 | ], |
| 626 | 604 | 'render_type' => 'template', |
| 627 | 605 | 'condition' => [ |
| 628 | 606 | 'style' => array_keys( $this->get_options_by_groups( $styles, 'line' )['options'] ), |
| @@ -707,9 +685,9 @@ | ||
| 707 | 685 | 'max' => 50, |
| 708 | 686 | ], |
| 709 | 687 | ], |
| 710 | 688 | 'selectors' => [ |
| 711 | - '{{WRAPPER}} .elementor-divider' => 'padding-block-start: {{SIZE}}{{UNIT}}; padding-block-end: {{SIZE}}{{UNIT}};', | |
| 689 | + '{{WRAPPER}} .elementor-divider' => 'padding-top: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};', | |
| 712 | 690 | ], |
| 713 | 691 | 'separator' => 'before', |
| 714 | 692 | ] |
| 715 | 693 | ); |
| @@ -788,25 +766,13 @@ | ||
| 788 | 766 | 'text_spacing', |
| 789 | 767 | [ |
| 790 | 768 | 'label' => esc_html__( 'Spacing', 'elementor' ), |
| 791 | 769 | 'type' => Controls_Manager::SLIDER, |
| 792 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 793 | 770 | 'range' => [ |
| 794 | 771 | 'px' => [ |
| 772 | + 'min' => 0, | |
| 795 | 773 | 'max' => 50, |
| 796 | 774 | ], |
| 797 | - '%' => [ | |
| 798 | - 'max' => 50, | |
| 799 | - ], | |
| 800 | - 'em' => [ | |
| 801 | - 'max' => 5, | |
| 802 | - ], | |
| 803 | - 'rem' => [ | |
| 804 | - 'max' => 5, | |
| 805 | - ], | |
| 806 | - 'vw' => [ | |
| 807 | - 'max' => 50, | |
| 808 | - ], | |
| 809 | 775 | ], |
| 810 | 776 | 'selectors' => [ |
| 811 | 777 | '{{WRAPPER}}' => '--divider-element-spacing: {{SIZE}}{{UNIT}};', |
| 812 | 778 | ], |
| @@ -845,19 +811,13 @@ | ||
| 845 | 811 | 'icon_size', |
| 846 | 812 | [ |
| 847 | 813 | 'label' => esc_html__( 'Size', 'elementor' ), |
| 848 | 814 | 'type' => Controls_Manager::SLIDER, |
| 849 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 850 | 815 | 'range' => [ |
| 851 | 816 | 'px' => [ |
| 852 | - 'max' => 100, | |
| 817 | + 'min' => 6, | |
| 818 | + 'max' => 300, | |
| 853 | 819 | ], |
| 854 | - 'em' => [ | |
| 855 | - 'max' => 10, | |
| 856 | - ], | |
| 857 | - 'rem' => [ | |
| 858 | - 'max' => 10, | |
| 859 | - ], | |
| 860 | 820 | ], |
| 861 | 821 | 'selectors' => [ |
| 862 | 822 | '{{WRAPPER}}' => '--divider-icon-size: {{SIZE}}{{UNIT}};', |
| 863 | 823 | ], |
| @@ -868,24 +828,16 @@ | ||
| 868 | 828 | 'icon_padding', |
| 869 | 829 | [ |
| 870 | 830 | 'label' => esc_html__( 'Padding', 'elementor' ), |
| 871 | 831 | 'type' => Controls_Manager::SLIDER, |
| 872 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 873 | 832 | 'selectors' => [ |
| 874 | 833 | '{{WRAPPER}} .elementor-icon' => 'padding: {{SIZE}}{{UNIT}};', |
| 875 | 834 | ], |
| 876 | 835 | 'range' => [ |
| 877 | - 'px' => [ | |
| 878 | - 'max' => 50, | |
| 879 | - ], | |
| 880 | 836 | 'em' => [ |
| 881 | 837 | 'min' => 0, |
| 882 | 838 | 'max' => 5, |
| 883 | 839 | ], |
| 884 | - 'rem' => [ | |
| 885 | - 'min' => 0, | |
| 886 | - 'max' => 5, | |
| 887 | - ], | |
| 888 | 840 | ], |
| 889 | 841 | 'condition' => [ |
| 890 | 842 | 'icon_view!' => 'default', |
| 891 | 843 | ], |
| @@ -946,9 +898,8 @@ | ||
| 946 | 898 | ], |
| 947 | 899 | ], |
| 948 | 900 | 'default' => 'center', |
| 949 | 901 | 'prefix_class' => 'elementor-widget-divider--element-align-', |
| 950 | - 'separator' => 'before', | |
| 951 | 902 | ] |
| 952 | 903 | ); |
| 953 | 904 | |
| 954 | 905 | $this->add_responsive_control( |
| @@ -955,24 +906,17 @@ | ||
| 955 | 906 | 'icon_spacing', |
| 956 | 907 | [ |
| 957 | 908 | 'label' => esc_html__( 'Spacing', 'elementor' ), |
| 958 | 909 | 'type' => Controls_Manager::SLIDER, |
| 959 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 960 | 910 | 'range' => [ |
| 961 | 911 | 'px' => [ |
| 912 | + 'min' => 0, | |
| 962 | 913 | 'max' => 50, |
| 963 | 914 | ], |
| 964 | - 'em' => [ | |
| 965 | - 'max' => 5, | |
| 966 | - ], | |
| 967 | - 'rem' => [ | |
| 968 | - 'max' => 5, | |
| 969 | - ], | |
| 970 | 915 | ], |
| 971 | 916 | 'selectors' => [ |
| 972 | 917 | '{{WRAPPER}}' => '--divider-element-spacing: {{SIZE}}{{UNIT}}', |
| 973 | 918 | ], |
| 974 | - 'separator' => 'before', | |
| 975 | 919 | ] |
| 976 | 920 | ); |
| 977 | 921 | |
| 978 | 922 | $this->add_responsive_control( |
| @@ -1136,16 +1080,6 @@ | ||
| 1136 | 1080 | <?php endif; ?> |
| 1137 | 1081 | </span> |
| 1138 | 1082 | </div> |
| 1139 | 1083 | <?php |
| 1140 | - } | |
| 1141 | - | |
| 1142 | - public function render_markdown(): string { | |
| 1143 | - $settings = $this->get_settings_for_display(); | |
| 1144 | - | |
| 1145 | - if ( 'line_text' === ( $settings['look'] ?? '' ) && ! empty( $settings['text'] ) ) { | |
| 1146 | - return '--- ' . Utils::html_to_plain_text( $settings['text'] ) . ' ---'; | |
| 1147 | - } | |
| 1148 | - | |
| 1149 | - return '---'; | |
| 1150 | 1084 | } |
| 1151 | 1085 | } |