| 开发者 | deniskey |
|---|---|
| 更新时间 | 2026年9月2日 16:13 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
articles)/wp-content/plugins/kda-custom-editor-buttonsVersion 1 targets Classic Editor / TinyMCE. A soft admin notice appears if the block editor is the default.
Yes on the front end, if the theme defines the classes you insert. The plugin also ships a default snippet window and token colors (light/dark). You can replace those stylesheets with the kda_ceb_snippet_css and kda_ceb_highlight_css filters.
Use the standard WordPress mce_css filter in your theme, or the plugin filters kda_ceb_snippet_css / kda_ceb_highlight_css. The plugin does not store custom CSS.
Yes, with the PHP filter kda_ceb_asset_base in your theme (it works for built-in, Prism.js and Highlight.js). The earlier kda_ceb_prism_base and kda_ceb_highlightjs_base filters still work and run on top of the universal one. See the Documentation tab in the settings screen or docs/adding-a-button.en.md / .ru.md.
English is the source language. Translations are managed on translate.wordpress.org. The full user guide is in docs/adding-a-button.en.md and docs/adding-a-button.ru.md, and is also rendered inside the plugin under Settings → KDA Editor Buttons → Documentation in the admin language.
Yes. Open Settings → KDA Editor Buttons → Customization, set a folder path (must start and end with /, relative to the site root). Use the Copy select to pick Built-in, Prism.js, Highlight.js, or All libraries, then add one of these snippets to wp-config.php:
```php
// short form: path comes from the setting above
define( 'KDA_CEB_CUSTOM_ASSETS', true );
// detailed form: path is also defined in wp-config (the form's path
// field becomes read-only when KDA_CEB_CUSTOM_PATH is set)
define( 'KDA_CEB_CUSTOM_ASSETS', true );
define( 'KDA_CEB_CUSTOM_PATH', '/wp-content/themes/your-child/kda-ceb/' );
```
The tab shows a green "Custom assets: active" badge when the constant is on. The plugin creates the destination folder if it doesn't exist, and surfaces a clear error when the web server can't write there. The tab reminds you to re-copy after a plugin update.
Yes. Define KDA_CEB_HIGHLIGHT_ENGINE (builtin | prism | highlightjs) and KDA_CEB_HIGHLIGHT_THEME (light | dark) in wp-config.php. When set, they override the settings screen and the corresponding fields become read-only. Use this together with KDA_CEB_CUSTOM_ASSETS to pin the entire asset configuration in code:
php
define( 'KDA_CEB_CUSTOM_ASSETS', true );
define( 'KDA_CEB_CUSTOM_PATH', '/wp-content/themes/your-child/kda-ceb/' );
define( 'KDA_CEB_HIGHLIGHT_ENGINE', 'prism' );
define( 'KDA_CEB_HIGHLIGHT_THEME', 'dark' );
KDA_CEB_LIBRARY_MODE constant (bundled | individual) forces library loading mode. When set, the corresponding UI option becomes read-only and shows a lock message.frontend-config.js when KDA_CEB_LIBRARY_MODE is set to bundled — config is now embedded directly into library .min.js files instead of loading separately.KDA_CEB_HIGHLIGHT_ENGINE (builtin | prism | highlightjs) and KDA_CEB_HIGHLIGHT_THEME (light | dark) override the admin settings. When defined, the corresponding fields in the settings screen become read-only.'Copy' / 'Copied!') in the admin UI and both user guides.wp-config.php via the new KDA_CEB_CUSTOM_PATH constant. When it's defined, the form's path field is read-only and the wp-config snippet in the tab shows the value. Two wp-config examples are shown side by side (short form and detailed form).KDA_CEB_CUSTOM_ASSETS constant in wp-config.php; the tab shows a green "active" / gray "inactive" badge. Path is any subfolder under the site root, must start and end with a forward slash.kda_ceb_asset_base for built-in, Prism.js and Highlight.js; the previous per-library filters still work and run on top of it.docs/ is shipped to the WordPress.org plugin so the Documentation tab works there too.mce_css or the plugin stylesheet filters)kda_ceb_prism_base / kda_ceb_highlightjs_base filters for theme developerstok-kw) before highlighting<pre> blocks are enhancedkda_ceb_highlight_css to use a theme stylesheet for token colorspre.dk-code line; BLOCK opens a large snippet window