Shortcake (Shortcode UI)
Used alongside add_shortcode , Shortcake supplies a user-friendly interface for adding a shortcode to a post, and viewing and editing it from within the content editor. Once you’ve installed the plugin, you’ll need to register UI for your shortcodes . For inspiration, check out examples of Shortcake
About this tool.
Used alongside add_shortcode , Shortcake supplies a user-friendly interface for adding a shortcode to a post, and viewing and editing it from within the content editor.
Once you’ve installed the plugin, you’ll need to register UI for your shortcodes . For inspiration, check out examples of Shortcake in the wild .
To report bugs or feature requests, please use Github issues .
Running tests
We have test coverage for PHP using PHPunit, and JavaScript using Jasmine.
Running tests locally
Jasmine tests can be run using grunt jasmine and are also run as part of the grunt scripts task. To update the core WordPress files used by the Jasmine test suite, run grunt updateJasmineCoreScripts --abspath="/path/to/wordpress-install" .
Screenshots & previews.
Getting started.
Shortcake can be installed like any other WordPress plugin.
Once you’ve done so, you’ll need to register the UI for your code .
New in 0.4.0 is the ability to attach javascript functions to event attribute updates . Action hooks can be used to dynamically show or hide a field based on the value of another, or to implement custom validation rules.
Frequently asked questions.
How do I register UI for arbitrary key/value pairs as shortcode attributes?
Shortcake doesn’t support custom key => value pairs as shortcode attributes because it isn’t a great user experience.
After upgrading to Shortcake 0.7.x, some of the shortcode UI fields (post select, user select, etc) don’t work as expected. What can I do?
In version 0.7.0, we updated to the most recent branch of the Select2 library, which provides the enhanced select fields in these field types. This causes a known conflict with plugins that enqueue older versions of Select2. (Popular plugins with known conflicts include WooCommerce and Advanced Custom Fields Pro, among others.)