PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.4
Elementor Website Builder – more than just a page builder v4.2.4
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 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/widgets/heading.php +28 -0 4.0.84.2.4 View file →
@@ -459,8 +459,36 @@
459 459 // PHPCS - the variable $title_html holds safe data.
460 460 echo $title_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
461 461 }
462 462
463 + public function render_markdown(): string {
464 + $settings = $this->get_settings_for_display();
465 +
466 + if ( '' === $settings['title'] ) {
467 + return '';
468 + }
469 +
470 + $tag = $settings['header_size'] ?? 'h2';
471 + $level_map = [
472 + 'h1' => 1,
473 + 'h2' => 2,
474 + 'h3' => 3,
475 + 'h4' => 4,
476 + 'h5' => 5,
477 + 'h6' => 6,
478 + ];
479 + $level = $level_map[ $tag ] ?? 2;
480 + $title = Utils::html_to_plain_text( $settings['title'] );
481 +
482 + $md = str_repeat( '#', $level ) . ' ' . $title;
483 +
484 + if ( ! empty( $settings['link']['url'] ) ) {
485 + $md = str_repeat( '#', $level ) . ' [' . $title . '](' . esc_url( $settings['link']['url'] ) . ')';
486 + }
487 +
488 + return $md;
489 + }
490 +
463 491 public function maybe_add_ally_heading_hint() {
464 492 $notice_id = 'ally_heading_notice';
465 493 $plugin_slug = 'pojo-accessibility';
466 494