← All changes
|
modules/atomic-widgets/elements/atomic-heading/atomic-heading.php
+1
-31
4.2.0-beta2
→
4.0.0-dev3
View file →
| @@ -59,10 +59,9 @@ | ||
| 59 | 59 | ->default( [ |
| 60 | 60 | 'content' => String_Prop_Type::generate( __( 'This is a title', 'elementor' ) ), |
| 61 | 61 | 'children' => [], |
| 62 | 62 | ] ) |
| 63 | - ->description( 'The text content of the heading.' ) | |
| 64 | - ->alias( 'text', 'content', 'heading' ), | |
| 63 | + ->description( 'The text content of the heading.' ), | |
| 65 | 64 | |
| 66 | 65 | 'link' => Link_Prop_Type::make(), |
| 67 | 66 | |
| 68 | 67 | 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ), |
| @@ -71,9 +70,8 @@ | ||
| 71 | 70 | |
| 72 | 71 | protected function define_atomic_controls(): array { |
| 73 | 72 | $content_section = Section::make() |
| 74 | 73 | ->set_label( __( 'Content', 'elementor' ) ) |
| 75 | - ->set_id( 'content' ) | |
| 76 | 74 | ->set_items( [ |
| 77 | 75 | Inline_Editing_Control::bind_to( 'title' ) |
| 78 | 76 | ->set_placeholder( __( 'Type your title here', 'elementor' ) ) |
| 79 | 77 | ->set_label( __( 'Title', 'elementor' ) ), |
| @@ -154,34 +152,6 @@ | ||
| 154 | 152 | protected function get_templates(): array { |
| 155 | 153 | return [ |
| 156 | 154 | 'elementor/elements/atomic-heading' => __DIR__ . '/atomic-heading.html.twig', |
| 157 | 155 | ]; |
| 158 | - } | |
| 159 | - | |
| 160 | - public function render_markdown(): string { | |
| 161 | - $settings = $this->get_atomic_settings(); | |
| 162 | - $title = wp_strip_all_tags( $settings['title'] ?? '' ); | |
| 163 | - | |
| 164 | - if ( empty( $title ) ) { | |
| 165 | - return ''; | |
| 166 | - } | |
| 167 | - | |
| 168 | - $tag = $settings['tag'] ?? 'h2'; | |
| 169 | - $level_map = [ | |
| 170 | - 'h1' => 1, | |
| 171 | - 'h2' => 2, | |
| 172 | - 'h3' => 3, | |
| 173 | - 'h4' => 4, | |
| 174 | - 'h5' => 5, | |
| 175 | - 'h6' => 6, | |
| 176 | - ]; | |
| 177 | - $level = $level_map[ $tag ] ?? 2; | |
| 178 | - | |
| 179 | - $md = str_repeat( '#', $level ) . ' ' . $title; | |
| 180 | - | |
| 181 | - if ( ! empty( $settings['link']['href'] ) ) { | |
| 182 | - $md = str_repeat( '#', $level ) . ' [' . $title . '](' . esc_url( $settings['link']['href'] ) . ')'; | |
| 183 | - } | |
| 184 | - | |
| 185 | - return $md; | |
| 186 | 156 | } |
| 187 | 157 | } |