PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.2.0
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.2.0
4.9.4 4.9.3 4.9.2 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 All 202 releases
betterdocs / views / templates / sidebars / sidebar-right.php

sidebar-right.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.2.0, at views/templates/sidebars/sidebar-right.php

64 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <aside id="betterdocs-sidebar-right" class="betterdocs-sidebar betterdocs-full-sidebar-right right-sidebar-toc-wrap">
2 <div data-simplebar class="layout3-toc-container right-sidebar-toc-container">
3 <?php
4 // Check if post is password protected and user hasn't provided correct password
5 if ( post_password_required() ) {
6 // Don't show ToC sidebar for password-protected posts until password is provided
7 echo '<div class="betterdocs-toc-password-protected">';
8 echo '<p>' . esc_html__( 'Table of Contents is available after entering the correct password.', 'betterdocs' ) . '</p>';
9 echo '</div>';
10 } else {
11 $hierarchy = betterdocs()->settings->get( 'toc_hierarchy' );
12 $list_number = betterdocs()->settings->get( 'toc_list_number' );
13 $supported_tag = betterdocs()->settings->get( 'supported_heading_tag' );
14 $htags = $supported_tag ? implode( ',', $supported_tag ) : '';
15
16 $attributes = betterdocs()->template_helper->get_html_attributes(
17 [
18 'htags' => "{$htags}",
19 'hierarchy' => "{$hierarchy}",
20 'list_number' => "{$list_number}",
21 'collapsible_on_mobile' => false
22 ]
23 );
24
25 echo do_shortcode( '[betterdocs_toc ' . $attributes . ']' );
26
27 if ( isset( $social_share ) && $social_share ) {
28 echo betterdocs()->views->get( 'templates/parts/social-2' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
29 }
30
31 if ( isset( $feedback ) && $feedback ) {
32 $reaction_text = betterdocs()->customizer->defaults->get( 'betterdocs_post_reactions_text_2' );
33 $reaction_text_tag = betterdocs()->customizer->defaults->get( 'betterdocs_reactions_title_tag' );
34 // Collect reaction values and icons
35 $reactions_data = [
36 'happy' => 'betterdocs_post_reactions_happy',
37 'happy_icon' => 'betterdocs_post_reactions_happy_icon',
38 'normal' => 'betterdocs_post_reactions_normal',
39 'normal_icon' => 'betterdocs_post_reactions_normal_icon',
40 'sad' => 'betterdocs_post_reactions_sad',
41 'sad_icon' => 'betterdocs_post_reactions_sad_icon'
42 ];
43
44 foreach ( $reactions_data as $key => $theme_mod ) {
45 $value = betterdocs()->customizer->defaults->get( $theme_mod );
46 if ( $value ) {
47 $args[ $key ] = $value;
48 } else {
49 $args[ $key ] = false;
50 }
51 }
52
53 // Build the attribute string for the shortcode
54 $attr = '';
55 foreach ( $args as $key => $value ) {
56 $attr .= sprintf( ' %s="%s"', esc_attr( $key ), esc_attr( $value ) );
57 }
58 echo do_shortcode( '[betterdocs_article_reactions text="' . $reaction_text . '" text_tag="' . $reaction_text_tag . '" layout="layout-3"' . $attr . ']' );
59 }
60 } // End password protection check
61 ?>
62 </div>
63 </aside>
64