This project is adding CodeMirror functionality to the Plugin and Theme file editors, as well as the Customizer Custom CSS box and the Custom HTML widget.
This is currently a Work In Progress playground for experimenting with bringing syntax highlighting to WordPress Core.
We’re working around discussion on a Core ticket, #12423
You can locate a ZIP for this plugin on the releases page on GitHub. To install, simply go to your WP Admin and Plugins > Add New. Then click “Upload Plugin” and select the
codemirror-wp.zip you downloaded from the releases page. Then click “Install Now” and on the next screen click “Activate Plugin”. Note on upgrading: If you want to update the plugin from a previous version, you must first deactivate it and uninstall it completely and then re-install and re-activate the new version (see #9757 for fixing this).
Otherwise, to set up the plugin for development: clone this repository and run
npm install to download CodeMirror and other assets.
cd wp-content/plugins/ git clone --recursive https://github.com/WordPress/codemirror-wp.git cd codemirror-wp npm install
Also install the pre-commit hook via:
cd .git/hooks && ln -s ../../dev-lib/pre-commit pre-commit && cd –
Any questions, reach out to #core-customize on WordPress.org Slack or better open an issue on GitHub!
Creating a Release
Contributors who want to make a new release, follow these steps:
- Bump plugin versions in
package-lock.json(×۱, just do
Stable Tag), and in
codemirror-wp.php(×۲: the metadata block in the header and also the
npm run build-release-zipto create a
codemirror-wp.zipin the plugin’s root directory.
- Create new release on GitHub targeting
master, with the new plugin version as the tag and release title, and upload the
codemirror-wp.zipas the associated binary. Publish the release.
“Syntax Highlighting Code Editor for WordPress Core” is open source software. The following people have contributed to this plugin.
[۰٫۳٫۰](https://github.com/WordPress/codemirror-wp/releases/tag/0.3.0) – ۲۰۱۷-۰۸-۱۸
- Enable line-wrapping and constrain width for file editor to match
textarea. See #33, #5, #32.
- Improve accessibility of CodeMirror in Customizer’s Additional CSS, including escape method from Tab trap. See #34 and #29.
- Improve file organization to prepare for core merge.
- See full commit log and diff: 0.2.0…۰٫۳٫۰
[۰٫۲٫۰](https://github.com/WordPress/codemirror-wp/releases/tag/0.2.0) – ۲۰۱۷-۰۸-۱۶
- Add user setting for disabling Syntax Highlighting. See #31.
- Improve release builds.
- See full commit log and diff: 0.1.0…۰٫۲٫۰
[۰٫۱٫۰](https://github.com/WordPress/codemirror-wp/releases/tag/0.1.0) – ۲۰۱۷-۰۸-۱۴