PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.2.6
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.2.6
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 3.5.2 All 199 releases
← All changes | includes/Core/Scripts.php +3 -37 4.9.14.2.6 View file →
@@ -1,15 +1,10 @@
1 1 <?php
2 +
2 3 namespace WPDeveloper\BetterDocs\Core;
3 4
4 -if ( ! defined( 'ABSPATH' ) ) {
5 - exit;
6 -}
7 -
8 -
9 5 use WPDeveloper\BetterDocs\Utils\Base;
10 6 use WPDeveloper\BetterDocs\Utils\Helper;
11 -use WPDeveloper\BetterDocs\FrontEnd\PrintTemplate;
12 7
13 8 class Scripts extends Base {
14 9 protected $settings;
15 10
@@ -77,25 +72,8 @@
77 72 $assets->register( 'betterdocs-reactions', 'shortcodes/js/reactions.js', [ 'jquery' ] );
78 73 $assets->register( 'betterdocs-search', 'shortcodes/js/search.js', [ 'jquery' ] );
79 74 $assets->register( 'betterdocs-search-modal', 'shortcodes/js/search-modal.js', [ 'jquery' ] );
80 75
81 - /**
82 - * Print template config for the single-doc Print / Save-as-PDF button.
83 - *
84 - * These values feed the print *popup* opened by the BetterDocs print
85 - * icon. The browser's own Ctrl/Cmd+P route is handled separately by
86 - * {@see PrintTemplate}, which resolves the same two values — see that
87 - * class for why the two routes use different layout mechanisms.
88 - *
89 - * Both toggles live in `betterdocs_settings` (BetterDocs → Settings →
90 - * Layout → Single Doc → General) rather than theme mods, so they stay
91 - * reachable on block/FSE themes, which have no Customizer. Both default
92 - * to OFF; while a toggle is off the value resolves empty and the print
93 - * script renders nothing for it.
94 - */
95 - $print_logo = PrintTemplate::get_logo();
96 - $print_footer = PrintTemplate::get_footer();
97 -
98 76 $assets->localize(
99 77 'betterdocs',
100 78 'betterdocsConfig',
101 79 [
@@ -102,13 +80,9 @@
102 80 'ajax_url' => admin_url( 'admin-ajax.php' ),
103 81 'copy_text' => __( 'Copied', 'betterdocs' ),
104 82 'sticky_toc_offset' => $this->settings->get( 'sticky_toc_offset' ),
105 83 'summary_nonce' => wp_create_nonce( 'betterdocs_article_summary_nonce' ),
106 - 'summary_error' => __( 'Failed to generate doc summary. Please try again.', 'betterdocs' ),
107 - 'print' => [
108 - 'logo' => $print_logo ? esc_url( $print_logo ) : '',
109 - 'footer' => $print_footer ? wp_kses_post( $print_footer ) : ''
110 - ]
84 + 'summary_error' => __( 'Failed to generate doc summary. Please try again.', 'betterdocs' )
111 85 ]
112 86 );
113 87
114 88 $assets->localize(
@@ -143,16 +117,13 @@
143 117 betterdocs()->assets->localize(
144 118 'betterdocs-category-grid',
145 119 'betterdocsCategoryGridConfig',
146 120 [
147 - 'is_betterdocs_templates' => betterdocs()->helper->is_templates() ? true : false,
148 - 'ajax_url' => admin_url( 'admin-ajax.php' ),
149 - 'lazy_load_action' => 'betterdocs_lazy_category_body'
121 + 'is_betterdocs_templates' => betterdocs()->helper->is_templates() ? true : false
150 122 ]
151 123 );
152 124
153 125 $this->blocks( $assets );
154 - $this->admin_assets( $assets );
155 126
156 127 return $assets;
157 128 }
158 129
@@ -165,11 +136,6 @@
165 136 $assets->register( 'betterdocs-blocks-category-tech-layout', 'blocks/category-tech-layout/default.css' );
166 137 $assets->register( 'betterdocs-blocks-category-slate-layout', 'blocks/category-slate-layout/default.css' );
167 138 $assets->register( 'betterdocs-feedback-form-editor', 'blocks/feedback-form/style-feedback-editor.css' );
168 139 $assets->register( 'betterdocs-doc-archive-list', 'blocks/doc-archive-list/default.css' );
169 - }
170 -
171 - public function admin_assets( $assets ) {
172 - $assets->register( 'betterdocs-article-quality-score', 'admin/js/article-quality-score.js', [ 'jquery' ] );
173 -
174 140 }
175 141 }