PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.5.3
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.5.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 3.5.1 All 200 releases
← All changes | includes/Plugin.php +64 -298 4.9.13.5.3 View file →
@@ -5,45 +5,32 @@
5 5 if ( ! defined( 'ABSPATH' ) ) {
6 6 exit; // Exit if accessed directly
7 7 }
8 8
9 -use WPDeveloper\BetterDocs\Admin\Analytics;
10 -use WPDeveloper\BetterDocs\Admin\Customizer\Customizer;
11 -use WPDeveloper\BetterDocs\Admin\HelpScoutMigration;
12 -use WPDeveloper\BetterDocs\Admin\ReportEmail;
13 9 use WPDeveloper\BetterDocs\Core\Admin;
14 -use WPDeveloper\BetterDocs\Core\AnalyticsTracker;
15 -use WPDeveloper\BetterDocs\Core\AnalyticsRetention;
10 +use WPDeveloper\BetterDocs\Core\Query;
11 +use WPDeveloper\BetterDocs\Core\Roles;
12 +use WPDeveloper\BetterDocs\Core\WriteWithAI;
13 +use WPDeveloper\BetterDocs\Dependencies\DI\Container;
14 +use WPDeveloper\BetterDocs\Utils\Views;
16 15 use WPDeveloper\BetterDocs\Core\BaseAPI;
17 16 use WPDeveloper\BetterDocs\Core\Install;
18 -use WPDeveloper\BetterDocs\Core\KBMigration;
19 -use WPDeveloper\BetterDocs\Core\Query;
20 17 use WPDeveloper\BetterDocs\Core\Request;
21 18 use WPDeveloper\BetterDocs\Core\Rewrite;
22 -use WPDeveloper\BetterDocs\Core\Roles;
23 19 use WPDeveloper\BetterDocs\Core\Scripts;
20 +use WPDeveloper\BetterDocs\Utils\Helper;
24 21 use WPDeveloper\BetterDocs\Core\Settings;
25 -use WPDeveloper\BetterDocs\Core\ShortcodeFactory;
26 -use WPDeveloper\BetterDocs\Core\WriteWithAI;
27 -use WPDeveloper\BetterDocs\Core\ArticleSummary;
28 -use WPDeveloper\BetterDocs\Core\ArticleQualityScore;
29 -use WPDeveloper\BetterDocs\Core\UnifiedMetabox;
30 -use WPDeveloper\BetterDocs\Core\DocsAISuite;
31 -use WPDeveloper\BetterDocs\Dependencies\DI\Container;
32 -use WPDeveloper\BetterDocs\Dependencies\DI\ContainerBuilder;
22 +use WPDeveloper\BetterDocs\Core\KBMigration;
23 +use WPDeveloper\BetterDocs\Utils\Enqueue;
33 24 use WPDeveloper\BetterDocs\Editors\Editor;
25 +use WPDeveloper\BetterDocs\Utils\Database;
26 +use WPDeveloper\BetterDocs\Admin\Analytics;
27 +use WPDeveloper\BetterDocs\Admin\ReportEmail;
34 28 use WPDeveloper\BetterDocs\FrontEnd\FrontEnd;
35 -use WPDeveloper\BetterDocs\FrontEnd\PrintTemplate;
36 -use WPDeveloper\BetterDocs\FrontEnd\SearchExtender;
29 +use WPDeveloper\BetterDocs\Core\ShortcodeFactory;
37 30 use WPDeveloper\BetterDocs\FrontEnd\TemplateTags;
38 -use WPDeveloper\BetterDocs\FrontEnd\WooProductFAQ;
39 -use WPDeveloper\BetterDocs\Abilities\AbilitiesRegistrar;
40 -use WPDeveloper\BetterDocs\Mcp\MCPManager;
41 -use WPDeveloper\BetterDocs\Modules\StyleHandler as ModulesStyleHandler;
42 -use WPDeveloper\BetterDocs\Utils\Database;
43 -use WPDeveloper\BetterDocs\Utils\Enqueue;
44 -use WPDeveloper\BetterDocs\Utils\Helper;
45 -use WPDeveloper\BetterDocs\Utils\Views;
31 +use WPDeveloper\BetterDocs\Admin\Customizer\Customizer;
32 +use WPDeveloper\BetterDocs\Dependencies\DI\ContainerBuilder;
46 33
47 34 final class Plugin {
48 35 private static $_instance = null;
49 36 /**
@@ -99,13 +86,8 @@
99 86 * @var TemplateTags
100 87 */
101 88 public $template_helper;
102 89 /**
103 - * Article Summary class
104 - * @var ArticleSummary
105 - */
106 - public $article_summary;
107 - /**
108 90 * Customizer class
109 91 * @var Customizer
110 92 */
111 93 public $customizer;
@@ -132,9 +114,9 @@
132 114 /**
133 115 * Plugin Version
134 116 * @var string
135 117 */
136 - public $version = '4.9.1';
118 + public $version = '3.5.3';
137 119
138 120 /**
139 121 * WriteWithAI Class
140 122 * @var string
@@ -139,27 +121,19 @@
139 121 * WriteWithAI Class
140 122 * @var string
141 123 */
142 124 public $ai_autowrtie;
143 - public $backgroundProccessor;
144 125
145 126 /**
146 - * ArticleQualityScore Class
147 - * @var ArticleQualityScore
148 - */
149 - public $article_quality_score;
150 -
151 - /**
152 127 * Plugin DB Version
153 128 * @var string
154 129 */
155 - public $db_version = '1.0.2';
130 + public $db_version = '1.0.1';
156 131
157 132 public function __construct() {
158 133 $this->define_constants();
159 134
160 135 do_action( 'betterdocs_init_before' );
161 -
162 136 $this->setup_container();
163 137 /**
164 138 * Register activation and deactivation hooks
165 139 * and version updates check
@@ -165,42 +139,21 @@
165 139 * and version updates check
166 140 */
167 141 $this->container->get( Install::class );
168 142
169 - /**
170 - * Abilities API registrar.
171 - *
172 - * Resolved here, at plugin load, and not from initialize(): both the
173 - * bundled Abilities API and WordPress core's build their registry as a
174 - * lazy singleton and fire `wp_abilities_api_init` from it, at or after
175 - * `init`, the first time anything reads the registry. Our listeners
176 - * therefore have to be attached before that first read, whenever it
177 - * happens — and a container resolve on `init` would already be too late
178 - * for a plugin that reads the registry earlier in the same hook.
179 - */
180 - $this->container->get( AbilitiesRegistrar::class );
143 + $this->initialize();
181 144
182 - add_action( 'init', array( $this, 'initialize' ), 0 );
145 + add_action( 'init', [ $this, 'init' ], 0 );
183 146
184 147 /**
185 - * Initialize API
186 - */
187 - add_action( 'rest_api_init', array( $this, 'api_initialization' ) );
188 -
189 - /**
190 148 * For admin only
191 149 */
192 - add_action( 'admin_init', array( $this, 'admin_init' ), 0 );
150 + add_action( 'admin_init', [ $this, 'admin_init' ], 0 );
193 151
194 152 /**
195 153 * For AJAX only
196 154 */
197 155 $this->ajax();
198 -
199 - /**
200 - * Style Handler For Parsing and Saving Styles as file.
201 - */
202 - ModulesStyleHandler::init();
203 156 }
204 157
205 158 private function define_constants() {
206 159 $this->define( 'BETTERDOCS_VERSION', $this->version );
@@ -207,11 +160,9 @@
207 160 $this->define( 'BETTERDOCS_DB_VERSION', $this->db_version );
208 161 $this->define( 'BETTERDOCS_ABSPATH', dirname( BETTERDOCS_PLUGIN_FILE ) . '/' );
209 162 $this->define( 'BETTERDOCS_ABSURL', plugin_dir_url( BETTERDOCS_PLUGIN_FILE ) );
210 163 $this->define( 'BETTERDOCS_PLUGIN_BASENAME', plugin_basename( BETTERDOCS_PLUGIN_FILE ) );
211 - // Compiled block metadata lives under assets/build/ since the Node 24 asset
212 - // restructure; register_block_type() fails silently if this path is wrong.
213 - $this->define( 'BETTERDOCS_BLOCKS_DIRECTORY', BETTERDOCS_ABSPATH . 'assets/build/blocks/' );
164 + $this->define( 'BETTERDOCS_BLOCKS_DIRECTORY', BETTERDOCS_ABSPATH . 'assets/blocks/' );
214 165 $this->define( 'BETTERDOCS_ROOT_DIR_PATH', plugin_dir_path( BETTERDOCS_PLUGIN_FILE ) );
215 166 $this->define( 'BETTERDOCS_FSE_TEMPLATES_PATH', BETTERDOCS_ROOT_DIR_PATH . 'views/templates/fse' );
216 167
217 168 /**
@@ -220,10 +171,8 @@
220 171 *
221 172 * WPML compatibility with Polylang
222 173 */
223 174 if ( Helper::is_plugin_active( 'polylang/polylang.php' ) ) {
224 - // Polylang's documented integration constant — must use the upstream-defined name.
225 - // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
226 175 define( 'PLL_WPML_COMPAT', false );
227 176 }
228 177 }
229 178
@@ -229,15 +178,13 @@
229 178
230 179 /**
231 180 * Define constant if not already set.
232 181 *
233 - * @param string $name Constant name.
182 + * @param string $name Constant name.
234 183 * @param string|bool $value Constant value.
235 184 */
236 185 private function define( $name, $value ) {
237 186 if ( ! defined( $name ) ) {
238 - // Caller passes plugin-prefixed names (BETTERDOCS_*); $name comes from a controlled internal allowlist.
239 - // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.VariableConstantNameFound
240 187 define( $name, $value );
241 188 }
242 189 }
243 190
@@ -250,68 +197,58 @@
250 197 $this->container = $builder->build();
251 198 }
252 199
253 200 public function initialize() {
254 -
255 - /**
256 - * Setup localization.
257 - */
258 - $this->load_plugin_textdomain();
259 -
260 201 $this->container->get( Scripts::class );
261 202 $this->rewrite = $this->container->get( Rewrite::class );
262 203 $this->request = $this->container->get( Request::class );
263 204 $this->query = $this->container->get( Query::class );
264 205
265 - // Initialize background process
266 - $this->backgroundProccessor = $this->container->get( HelpScoutMigration::class );
267 -
268 206 $this->rewrite->init();
269 207 $this->request->init();
270 208
271 - $this->assets = $this->container->get( Enqueue::class );
272 - $this->views = $this->container->get( Views::class );
273 - $this->helper = $this->container->get( Helper::class );
274 - $this->kbmigration = $this->container->get( KBMigration::class );
275 - $this->admin = $this->container->get( Admin::class );
276 - $this->database = $this->container->get( Database::class );
277 - $this->settings = $this->container->get( Settings::class );
278 - $this->analytics = $this->container->get( Analytics::class );
279 - // Free analytics collectors: the frontend view/scroll tracker and the
280 - // daily retention purge. Each self-registers its hooks on construct.
281 - $this->container->get( AnalyticsTracker::class );
282 - $this->container->get( AnalyticsRetention::class );
209 + $this->assets = $this->container->get( Enqueue::class );
210 + $this->views = $this->container->get( Views::class );
211 + $this->helper = $this->container->get( Helper::class );
212 + $this->kbmigration = $this->container->get( KBMigration::class );
213 + $this->admin = $this->container->get( Admin::class );
214 + $this->database = $this->container->get( Database::class );
215 + $this->settings = $this->container->get( Settings::class );
216 + $this->analytics = $this->container->get( Analytics::class );
283 217
284 218 $this->template_helper = $this->container->get( TemplateTags::class );
285 219 $this->customizer = $this->container->get( Customizer::class );
286 220 $this->editor = $this->container->get( Editor::class );
287 - $this->ai_autowrtie = $this->container->get( WriteWithAI::class );
288 - $this->article_summary = $this->container->get( ArticleSummary::class );
221 + $this->ai_autowrtie = $this->container->get( WriteWithAI::class );
289 222
290 - // Initialize unified metabox before individual features
291 - $this->container->get( UnifiedMetabox::class );
292 - $this->article_quality_score = $this->container->get( ArticleQualityScore::class );
223 + /**
224 + * Initialize all editors.
225 + * Elementor, Gutenberg/BlockEditor
226 + */
227 + add_action( 'init', [ $this->editor, 'init' ] );
293 228
294 - // Editor "Suggest Categories / Tags / Glossaries" AI actions on the docs
295 - // post type (gated by enable_docs_ai_suite + an OpenAI key inside the class).
296 - $this->container->get( DocsAISuite::class );
229 + /**
230 + * Initialize API
231 + */
232 + add_action( 'rest_api_init', [ $this, 'api_initialization' ] );
233 + }
297 234
298 - $this->container->get( Admin::class );
299 - $this->container->get( Roles::class );
300 -
235 + /**
236 + * Initialize the BetterDocs Plugin
237 + *
238 + * @return void
239 + * @since 2.5.0
240 + */
241 + public function init() {
301 242 /**
302 - * MCP transport: rewrite rules, the pretty endpoint, OAuth discovery
303 - * and every REST route. Resolved here rather than at plugin load
304 - * (where the abilities registrar has to be) because its earliest hook
305 - * is `init`, which is what this method already runs on.
243 + * Setup localization.
306 244 */
307 - $this->container->get( MCPManager::class );
245 + $this->load_plugin_textdomain();
308 246
247 + $this->container->get( Admin::class );
248 + $this->container->get( Roles::class );
309 249 $this->container->get( ReportEmail::class );
310 - // Usage-analytics collector. Registered here (runs on every request, incl.
311 - // WP-Cron) rather than in Admin so its `betterdocs_insights_data` filter
312 - // callback is present whenever the tracking payload is built.
313 - $this->container->get( \WPDeveloper\BetterDocs\Insights\Collector::class );
250 +
314 251 /**
315 252 * Initialize Shortcode
316 253 * Make sure you have listed out all shortcode in shortcode factory.
317 254 */
@@ -317,24 +254,10 @@
317 254 */
318 255 $this->container->get( ShortcodeFactory::class )->init();
319 256
320 257 $this->container->get( FrontEnd::class );
321 - $this->container->get( SearchExtender::class );
322 258
323 - // Running logo header / page footer for the browser's own Print command.
324 - // Registered unconditionally: it covers every front-end page, including
325 - // the ones that carry no BetterDocs print button.
326 - $this->container->get( PrintTemplate::class );
327 -
328 - /**
329 - * Single-product FAQ rendering (WooCommerce). The class itself bails when
330 - * WooCommerce is inactive or the feature is disabled.
331 - */
332 - $this->container->get( WooProductFAQ::class );
333 -
334 259 do_action( 'betterdocs_init' );
335 -
336 - $this->editor->init();
337 260 }
338 261
339 262 /**
340 263 * Load plugins textdomain `betterdocs` into actions.
@@ -345,16 +268,13 @@
345 268
346 269 /**
347 270 * Filter to adjust the BetterDocs locale to use for translations.
348 271 */
349 - // 'plugin_locale' is a WP-core filter; using its documented name is required.
350 - // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
351 272 $locale = apply_filters( 'plugin_locale', $locale, $textdomain );
352 273
353 - if ( file_exists( WP_LANG_DIR . "/$textdomain-" . $locale . '.mo' ) ) {
354 - unload_textdomain( $textdomain );
355 - load_textdomain( $textdomain, WP_LANG_DIR . "/$textdomain-" . $locale . '.mo' );
356 - }
274 + unload_textdomain( $textdomain );
275 + load_textdomain( $textdomain, WP_LANG_DIR . "/$textdomain-" . $locale . '.mo' );
276 + load_plugin_textdomain( $textdomain, false, plugin_basename( dirname( $plugin_file ) ) . '/languages' );
357 277 }
358 278
359 279 /**
360 280 * For AJAX Only
@@ -373,15 +293,15 @@
373 293 * @suppress PHP0441
374 294 * @since 2.5.0
375 295 */
376 296 public static function get_instance() {
377 - if ( null == self::$_instance ) {
378 - self::$_instance = new self();
297 + if ( static::$_instance == null ) {
298 + static::$_instance = new self();
379 299
380 300 do_action( 'betterdocs_loaded' );
381 301 }
382 302
383 - return self::$_instance;
303 + return static::$_instance;
384 304 }
385 305
386 306 /**
387 307 * Hooked with `admin_init` action.
@@ -408,18 +328,14 @@
408 328 // Delete the activation transient.
409 329 $this->database->delete_transient( 'betterdocs_maybe_redirect' );
410 330
411 331 if ( ! is_multisite() ) {
412 - $betterdocs_settings = get_option( 'betterdocs_settings' );
413 - if ( $betterdocs_settings ) {
414 - wp_safe_redirect( add_query_arg( array( 'page' => 'betterdocs-settings' ), admin_url( 'admin.php' ) ) );
332 + $betterdocs_settings = get_option('betterdocs_settings');
333 + if ( $betterdocs_settings) {
334 + wp_safe_redirect( add_query_arg( [ 'page' => 'betterdocs-settings' ], admin_url( 'admin.php' ) ) );
415 335 } else {
416 - wp_safe_redirect( add_query_arg( array( 'page' => 'betterdocs-setup' ), admin_url( 'admin.php' ) ) );
336 + wp_safe_redirect( add_query_arg( [ 'page' => 'betterdocs-setup' ], admin_url( 'admin.php' ) ) );
417 337 }
418 - // This runs at `admin_init` priority 0. Without exiting, the rest of
419 - // admin_init still executes and can mutate the very state the redirect
420 - // target depends on before the browser ever follows the Location header.
421 - exit;
422 338 }
423 339 }
424 340
425 341 /**
@@ -433,101 +349,13 @@
433 349 /**
434 350 * Is Pro Plugin Is Active?
435 351 * @return bool
436 352 */
437 - public function pro_file() {
438 - return WP_PLUGIN_DIR . '/betterdocs-pro/betterdocs-pro.php';
439 - }
440 -
441 353 public function is_pro_active() {
442 - if ( file_exists( $this->pro_file() ) ) {
443 - return $this->helper->is_plugin_active( 'betterdocs-pro/betterdocs-pro.php' );
444 - }
445 -
446 - return false;
354 + return $this->helper->is_plugin_active( 'betterdocs-pro/betterdocs-pro.php' );
447 355 }
448 356
449 - public function chatbot_file() {
450 - return WP_PLUGIN_DIR . '/betterdocs-ai-chatbot/betterdocs-ai-chatbot.php';
451 - }
452 -
453 - public function is_chatbot_active() {
454 - if ( file_exists( $this->chatbot_file() ) ) {
455 - return $this->helper->is_plugin_active( 'betterdocs-ai-chatbot/betterdocs-ai-chatbot.php' );
456 - }
457 -
458 - return false;
459 - }
460 -
461 357 /**
462 - * Whether Pro provides the real API Documentation screen.
463 - *
464 - * Pro flips this via `betterdocs_pro_has_api_docs`; the class_exists() default
465 - * keeps the gate correct against a Pro build that predates that filter.
466 - *
467 - * @return bool
468 - */
469 - public function has_api_docs() {
470 - return (bool) apply_filters(
471 - 'betterdocs_pro_has_api_docs',
472 - class_exists( '\\WPDeveloper\\BetterDocsPro\\Core\\ApiReferences' )
473 - );
474 - }
475 -
476 - /**
477 - * Whether Free should show its locked API Docs teaser.
478 - *
479 - * Only without Pro. An older Pro has already paid, so they get nothing here —
480 - * they need a plugin update, not an upsell.
481 - *
482 - * @return bool
483 - */
484 - public function show_api_docs_teaser() {
485 - return ! $this->is_pro_active() && ! $this->has_api_docs();
486 - }
487 -
488 - /**
489 - * Whether the real Glossaries screen is available (i.e. Pro is licensing it).
490 - *
491 - * Glossaries ships in Free's code but is Pro-licensed, so unlike API Docs there
492 - * is no separate Pro class to detect — the gate is simply Pro being active. Kept
493 - * behind a filter so Pro/add-ons can flip it explicitly, mirroring
494 - * `betterdocs_pro_has_api_docs`.
495 - *
496 - * @return bool
497 - */
498 - public function has_glossaries() {
499 - return (bool) apply_filters( 'betterdocs_pro_has_glossaries', $this->is_pro_active() );
500 - }
501 -
502 - /**
503 - * Whether Free should show its locked Glossaries teaser.
504 - *
505 - * Only without Pro — an active Pro either has the feature or has simply left it
506 - * disabled in settings; neither case wants an upsell. Mirrors
507 - * show_api_docs_teaser().
508 - *
509 - * @return bool
510 - */
511 - public function show_glossary_teaser() {
512 - return ! $this->is_pro_active() && ! $this->has_glossaries();
513 - }
514 -
515 - public function pro_version() {
516 - if ( ! $this->is_pro_active() ) {
517 - return false;
518 - }
519 -
520 - if ( ! function_exists( 'get_plugin_data' ) ) {
521 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
522 - }
523 -
524 - $plugin_data = get_plugin_data( $this->pro_file() );
525 -
526 - return $plugin_data[ 'Version' ];
527 - }
528 -
529 - /**
530 358 * Get all the API initialized.
531 359 * @return void
532 360 */
533 361 public function api_initialization() {
@@ -534,9 +362,9 @@
534 362 $_api_classes = scandir( __DIR__ . DIRECTORY_SEPARATOR . 'REST' );
535 363
536 364 if ( ! empty( $_api_classes ) && is_array( $_api_classes ) ) {
537 365 foreach ( $_api_classes as $class ) {
538 - if ( '.' == $class || '..' == $class || strpos( $class, '.' ) === 0 ) {
366 + if ( $class == '.' || $class == '..' || strpos( $class, '.' ) === 0) {
539 367 continue;
540 368 }
541 369
542 370 $classname = basename( $class, '.php' );
@@ -547,68 +375,6 @@
547 375 $_api_class->register();
548 376 }
549 377 }
550 378 }
551 - }
552 -
553 - public function is_betterdocs_screen( $hook, $admin_check = true ): bool {
554 - /**
555 - * Filter the list of admin screen hook suffixes treated as BetterDocs
556 - * screens (controls whether the React admin bundle + styles load).
557 - * Pro/add-ons can register their own React pages here, e.g. the
558 - * Knowledge Base admin page.
559 - *
560 - * @param string[] $screens Full hook suffixes (e.g. betterdocs_page_betterdocs-foo).
561 - */
562 - $screens = apply_filters( 'betterdocs_admin_screens', array(
563 - 'toplevel_page_betterdocs-dashboard',
564 - 'toplevel_page_betterdocs-admin',
565 - 'admin_page_betterdocs-admin',
566 - 'betterdocs_page_betterdocs-admin',
567 - 'betterdocs_page_betterdocs-analytics',
568 - 'betterdocs_page_betterdocs-settings',
569 - 'betterdocs_page_betterdocs-mcp',
570 - 'betterdocs_page_betterdocs-faq',
571 - 'betterdocs_page_betterdocs-glossaries',
572 - 'betterdocs_page_betterdocs-ai-chatbot',
573 - 'betterdocs_page_betterdocs-api-docs',
574 - 'betterdocs_page_betterdocs-doc-categories',
575 - 'betterdocs_page_betterdocs-doc-tags',
576 - ) );
577 -
578 - if ( $admin_check ) {
579 - if ( in_array( $hook, $screens ) ) {
580 - return true;
581 - }
582 -
583 - return false;
584 - }
585 -
586 - return false;
587 - }
588 -
589 - public function get_betterdocs_screen() {
590 - $registered_screens = array(
591 - 'toplevel_page_betterdocs-dashboard',
592 - 'admin_page_betterdocs-admin',
593 - 'betterdocs_page_betterdocs-admin',
594 - 'betterdocs_page_betterdocs-settings',
595 - 'betterdocs_page_betterdocs-mcp',
596 - 'betterdocs_page_betterdocs-analytics',
597 - 'betterdocs_page_betterdocs-faq',
598 - 'betterdocs_page_betterdocs-glossaries',
599 - 'betterdocs_page_betterdocs-ai-chatbot',
600 - 'betterdocs_page_betterdocs-api-docs',
601 - 'betterdocs_page_betterdocs-doc-categories',
602 - 'betterdocs_page_betterdocs-doc-tags',
603 - 'edit-docs'
604 - );
605 -
606 - $current_screen_id = get_current_screen() != null ? get_current_screen()->id : '';
607 -
608 - if ( in_array( $current_screen_id, $registered_screens ) ) {
609 - return $current_screen_id;
610 - }
611 -
612 - return false;
613 379 }
614 380 }