Shortcake, a plugin that adds a UI to make shortcodes more user friendly, is now an official WordPress feature plugin. The project is led by Daniel Bachhuber, currently the interim director of engineering at Fusion, the company where Shortcake originated.
The plugin is being developed on GitHub but is also now available for download on WordPress.org. Developers who want to utilize Shortcake can register a UI for their shortcodes alongside add_shortcode, which will expose Shortcake’s user-friendly interface.
Shortcake transforms your ordinary shortcode to render a preview in a TinyMCE view:
It also supplies a user-friendly UI to add shortcodes via the “Add Media” button. After selecting your shortcode, you’ll have the ability to edit its content and attributes.
Version 0.2.0 enhances the post element interface in the following ways:
- Shortcodes are sorted alphabetically, making it easier to skim and find shortcodes.
- Shortcodes can be filtered by name using the “Search” field, reducing complexity when a site has many dozens of shortcodes.
- The “Insert Element” button is disabled until a post element is selected, providing a visual cue to the user.
This release also makes a number of significant changes to the structure of the plugin. It has been retooled using an MVC architecture that relies on Browserify. Shortcake contributor Jitendra Harpalani explains the reasons behind the changes:
Does Shortcake have a chance to make it into WordPress core?
Although shortcodes make it easy to insert and structure complex content, they’re an eyesore in the post editor. Including multiple shortcodes the old fashioned way can quickly become messy.
Shortcake is a well-conceived solution that brings new life to shortcodes and makes them significantly less confusing to implement. Contributors on the project believe in it enough to start working on the steps necessary to make the feature plugin ready to be proposed for core.
If it does land in core someday, it will be interesting to see how well the feature is adopted. If some developers register a UI for their shortcodes and others don’t, it could be confusing to know which shortcodes are available if they don’t show up on the “Insert Element” screen. Then again, that problem already exists without Shortcake. Without the help of an additional plugin, there’s no easy way to know which shortcodes are available.
If you think Shortcake has potential and want to get involved, follow the updates on make.wordpress.org/core and join the development team for a meeting on WordPress.org Slack.
Source: WP Tavern