| Server IP : 121.121.20.254 / Your IP : 216.73.217.109 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/KnowledgeBase/wp-content/plugins/betterdocs/includes/Shortcodes/ |
Upload File : |
<?php
namespace WPDeveloper\BetterDocs\Shortcodes;
use WPDeveloper\BetterDocs\Core\Shortcode;
class PostContent extends Shortcode {
protected $html_attributes = [];
public function get_name() {
return 'betterdocs_post_content';
}
/**
* Summary of default_attributes
* @return array
*/
public function default_attributes() {
return [
'post_id' => get_the_ID(),
'htags' => 'h1,h2,h3,h4,h5,h6',
'enable_toc' => '',
'toc_hierarchy' => '',
'list_number' => '',
'display_toc_on_top' => '',
'collapsible_toc_mobile' => ''
];
}
public function render( $atts, $content = null ) {
$post = get_post( $get_args['post_id'] );
return betterdocs()->template_helper->content(
$post->post_content,
$this->attributes['htags'],
$this->attributes['enable_toc']
);
}
}