| 1 |
<?php |
| 2 |
if ( ! betterdocs()->settings->get( 'enable_toc', false ) ) { |
| 3 |
return; |
| 4 |
} |
| 5 |
|
| 6 |
$toc_hierarchy = betterdocs()->settings->get( 'toc_hierarchy' ); |
| 7 |
$toc_list_number = betterdocs()->settings->get( 'toc_list_number' ); |
| 8 |
$collapsible_toc_mobile = betterdocs()->settings->get( 'collapsible_toc_mobile' ); |
| 9 |
$supported_tag = betterdocs()->settings->get( 'supported_heading_tag', '' ); |
| 10 |
$htags = $supported_tag ? implode( ',', $supported_tag ) : ''; |
| 11 |
|
| 12 |
$attributes = betterdocs()->template_helper->get_html_attributes([ |
| 13 |
'htags' => "{$htags}", |
| 14 |
'hierarchy' => "{$toc_hierarchy}", |
| 15 |
'list_number' => "{$toc_list_number}", |
| 16 |
'collapsible_on_mobile' => "{$collapsible_toc_mobile}" |
| 17 |
]); |
| 18 |
|
| 19 |
echo do_shortcode( "[betterdocs_toc ". $attributes ."]" ); |
| 20 |
|