PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 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 All 203 releases
betterdocs / react-src / admin / switcher.js

switcher.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/admin/switcher.js

26 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function ($) {
2 "use strict";
3 $(document).ready(function () {
4 var cfg = window.betterdocsSwitcher;
5 if (!cfg || !cfg.page) {
6 return;
7 }
8 // Inject the "Switch to BetterDocs UI" button next to the page heading.
9 // The script is only enqueued on the relevant classic screens (Docs,
10 // FAQ, FAQ groups, Product FAQ groups, Doc Categories, Doc Tags), so
11 // targeting the first .wp-heading-inline is safe. `cfg.url` is the
12 // full React admin page URL (it can carry extra args like the FAQ
13 // Builder tab); `cfg.page` is the older slug-only fallback.
14 var href = cfg.url || "admin.php?page=" + cfg.page;
15 $(".wp-heading-inline")
16 .first()
17 .after(
18 '<a href="' +
19 href +
20 '" class="page-title-action betterdocs-ui-switch">' +
21 (cfg.menu_title || "Switch to BetterDocs UI") +
22 "</a>"
23 );
24 });
25 })(jQuery);
26