← All changes
|
modules/atomic-widgets/elements/atomic-heading/atomic-heading.php
+3
-34
4.1.0-beta2
→
3.35.8
View file →
| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base; |
| 10 | 10 | use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Template; |
| 11 | 11 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 12 | 12 | use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| 13 | -use Elementor\Modules\AtomicWidgets\PropTypes\Html_V3_Prop_Type; | |
| 13 | +use Elementor\Modules\AtomicWidgets\PropTypes\Html_Prop_Type; | |
| 14 | 14 | use Elementor\Modules\AtomicWidgets\PropTypes\Link_Prop_Type; |
| 15 | 15 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 16 | 16 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 17 | 17 | use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| @@ -54,13 +54,10 @@ | ||
| 54 | 54 | ->enum( [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ] ) |
| 55 | 55 | ->default( 'h2' ) |
| 56 | 56 | ->description( 'The HTML tag for the heading element. Could be h1, h2, up to h6' ), |
| 57 | 57 | |
| 58 | - 'title' => Html_V3_Prop_Type::make() | |
| 59 | - ->default( [ | |
| 60 | - 'content' => String_Prop_Type::generate( __( 'This is a title', 'elementor' ) ), | |
| 61 | - 'children' => [], | |
| 62 | - ] ) | |
| 58 | + 'title' => Html_Prop_Type::make() | |
| 59 | + ->default( __( 'This is a title', 'elementor' ) ) | |
| 63 | 60 | ->description( 'The text content of the heading.' ), |
| 64 | 61 | |
| 65 | 62 | 'link' => Link_Prop_Type::make(), |
| 66 | 63 | |
| @@ -152,34 +149,6 @@ | ||
| 152 | 149 | protected function get_templates(): array { |
| 153 | 150 | return [ |
| 154 | 151 | 'elementor/elements/atomic-heading' => __DIR__ . '/atomic-heading.html.twig', |
| 155 | 152 | ]; |
| 156 | - } | |
| 157 | - | |
| 158 | - public function render_markdown(): string { | |
| 159 | - $settings = $this->get_atomic_settings(); | |
| 160 | - $title = wp_strip_all_tags( $settings['title'] ?? '' ); | |
| 161 | - | |
| 162 | - if ( empty( $title ) ) { | |
| 163 | - return ''; | |
| 164 | - } | |
| 165 | - | |
| 166 | - $tag = $settings['tag'] ?? 'h2'; | |
| 167 | - $level_map = [ | |
| 168 | - 'h1' => 1, | |
| 169 | - 'h2' => 2, | |
| 170 | - 'h3' => 3, | |
| 171 | - 'h4' => 4, | |
| 172 | - 'h5' => 5, | |
| 173 | - 'h6' => 6, | |
| 174 | - ]; | |
| 175 | - $level = $level_map[ $tag ] ?? 2; | |
| 176 | - | |
| 177 | - $md = str_repeat( '#', $level ) . ' ' . $title; | |
| 178 | - | |
| 179 | - if ( ! empty( $settings['link']['href'] ) ) { | |
| 180 | - $md = str_repeat( '#', $level ) . ' [' . $title . '](' . esc_url( $settings['link']['href'] ) . ')'; | |
| 181 | - } | |
| 182 | - | |
| 183 | - return $md; | |
| 184 | 153 | } |
| 185 | 154 | } |