PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.9
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.9
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 3.5.0 All 201 releases
← All changes | includes/Editors/BlockEditor/Blocks/ToC.php +0 -18 4.9.2 → 3.8.9 View file →
@@ -44,27 +44,9 @@
44 44 ];
45 45 }
46 46
47 47 public function render( $attributes, $content ) {
48 - // Check if post is password protected and user hasn't provided correct password
49 - // Skip check in editor mode
50 - if ( ! $this->is_editor_mode() && post_password_required() ) {
51 - // Don't show ToC for password-protected posts until password is provided
52 - return '';
53 - }
54 -
55 48 $this->views( 'widgets/toc' );
56 - }
57 -
58 - /**
59 - * Check if we're in editor mode
60 - *
61 - * @return bool
62 - */
63 - private function is_editor_mode() {
64 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- REST request context check.
65 - $context = isset( $_REQUEST['context'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['context'] ) ) : '';
66 - return defined( 'REST_REQUEST' ) && REST_REQUEST && 'edit' === $context;
67 49 }
68 50
69 51 public function view_params() {
70 52 $htags = [];