PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.6.1
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.6.1
4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.5.2 All 199 releases
betterdocs / includes / Shortcodes / PostContent.php

PostContent.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.6.1, at includes/Shortcodes/PostContent.php

40 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDeveloper\BetterDocs\Shortcodes;
4
5 use WPDeveloper\BetterDocs\Core\Shortcode;
6
7 class PostContent extends Shortcode {
8 protected $html_attributes = [];
9
10 public function get_name() {
11 return 'betterdocs_post_content';
12 }
13
14 /**
15 * Summary of default_attributes
16 * @return array
17 */
18 public function default_attributes() {
19 return [
20 'post_id' => get_the_ID(),
21 'htags' => 'h1,h2,h3,h4,h5,h6',
22 'enable_toc' => '',
23 'toc_hierarchy' => '',
24 'list_number' => '',
25 'display_toc_on_top' => '',
26 'collapsible_toc_mobile' => ''
27 ];
28 }
29
30 public function render( $atts, $content = null ) {
31 $post = get_post( $get_args['post_id'] );
32
33 return betterdocs()->template_helper->content(
34 $post->post_content,
35 $this->attributes['htags'],
36 $this->attributes['enable_toc']
37 );
38 }
39 }
40