PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.0-beta1
Elementor Website Builder – more than just a page builder v4.1.0-beta1
4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 All 456 releases
← All changes | modules/atomic-widgets/elements/atomic-heading/atomic-heading.php +28 -0 4.0.9 → 4.1.0-beta1 View file →
@@ -153,5 +153,33 @@
153 153 return [
154 154 'elementor/elements/atomic-heading' => __DIR__ . '/atomic-heading.html.twig',
155 155 ];
156 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 + }
157 185 }