Shortcake (Shortcode UI)
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.
To report bugs or feature requests, please use Github issues.
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".
Shortcake can be installed like any other WordPress plugin.
Once you’ve done so, you’ll need to register the UI for your code.
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.)
If you find that you’re experiencing conflicts with these plugins, you can set a flag to load select2 in a distinct namespace by defining the constant
SELECT2_NOCONFLICT in your wp-config.php (or anywhere that’s defined before the ‘init’ hook.)
define( 'SELECT2_NOCONFLICT', true );