| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | <aside id="betterdocs-sidebar-right" class="betterdocs-sidebar betterdocs-full-sidebar-right right-sidebar-toc-wrap"> |
| 2 | 2 | <div data-simplebar class="layout3-toc-container right-sidebar-toc-container"> |
| 3 | 3 | <?php |
| 4 | - // Check if post is password protected and user hasn't provided correct password | |
| 4 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 5 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | + exit; | |
| 7 | +} | |
| 8 | +// Check if post is password protected and user hasn't provided correct password | |
| 5 | 9 | if ( post_password_required() ) { |
| 6 | 10 | // Don't show ToC sidebar for password-protected posts until password is provided |
| 7 | 11 | echo '<div class="betterdocs-toc-password-protected">'; |
| 8 | 12 | echo '<p>' . esc_html__( 'Table of Contents is available after entering the correct password.', 'betterdocs' ) . '</p>'; |
| @@ -59,5 +63,13 @@ | ||
| 59 | 63 | } |
| 60 | 64 | } // End password protection check |
| 61 | 65 | ?> |
| 62 | 66 | </div> |
| 67 | + <?php | |
| 68 | + /** | |
| 69 | + * Fires inside the right (ToC) sidebar, after the ToC container. Extension | |
| 70 | + * point for add-ons that render a sticky side panel next to the ToC (e.g. | |
| 71 | + * BetterDocs Pro's API-docs code-sample panel). | |
| 72 | + */ | |
| 73 | + do_action( 'betterdocs_after_toc_sidebar' ); | |
| 74 | + ?> | |
| 63 | 75 | </aside> |