wp-admin-codemirror
Installation
SKILL.md
WordPress Admin CodeMirror (wp.codeEditor)
WP bundles CodeMirror 5 plus its linter add-ons. Plugins almost never use it because the entry point is one underused function (wp_enqueue_code_editor) and the JS init is split between two files. This skill is the bootstrap recipe.
When to use this skill
Trigger when ANY of the following is true:
- The user is adding a
<textarea>to admin for CSS / JSON / JS / HTML / PHP / SQL / regex / Markdown / YAML content and wants syntax highlighting (NOT the block editor). - Code references
wp_enqueue_code_editor,wp_get_code_editor_settings,wp.codeEditor,wp.CodeMirror,wp_code_editor_settings,code-editorscript handle. - The user is building a "custom CSS field", "snippet editor", "JSON config editor", "webhook payload field", "regex builder", "shortcode preview", "rules engine".
- The user mentions CodeMirror, Monaco, Ace, Prism specifically in a WP-admin context — and the answer is "use the bundled CodeMirror".