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

Without Shortcake, shortcodes have a minimal UI.

But with Shortcake, TinyMCE will render the shortcode in a TinyMCE view.

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.)

This is a fantastic idea, it retains the normal functionality of WordPress Shortcodes where as developers can properly control the output and the end users simply use the shortcode in a more intuitive way.

Please develop THIS and NOT GUTENBERG.

PS bonus round: WooCommerce is training wheels for Magento, if you are using Woo and not liking it then its time for you to get off the the pedal bike and buy a real car, ie: Magento.

0.3.0 (April 27, 2015)

Breaking change: We’ve removed the compatibility shim for the magical content attribute. If you were using this to support editing inner content, you’ll need to change your UI registration to use inner_content.

New post_select field type for selecting from a list of posts. Supports an additional query parameter to modify the search query.

Using a new post_type argument, shortcode UI can be registered for specific post types. This is helpful if you want the UI for a given shortcode to only appear on specific post types.

For each shortcode attribute, a meta argument can be specified to add arbitrary HTML attributes to the field. We’ve added a compatibility shim for the existing placeholder argument. This compatibility shim will be removed in v0.4.

When inserting a shortcode, UI shows a helpful message when the shortcode doesn’t have attributes to configure. Previously, the user was presented with a relatively blank screen.

Our example plugin can be activated through the WordPress admin.

Clicking “Insert Post Element” in the left menu effectively acts as back button to selecting a shortcode.