Once upon a time, a long time ago back in release 2.5 in 2008, the shortcode API was released into the world of WordPress. It allowed users to insert complex page elements, such as a gallery or blockquote, by adding a short piece of code with square brackets, [name attr = “value”]
, via the post admin. This shortcode was then output as html in the post.
The shortcodes worked and did what they were supposed to, however like sleeping beauty in her castle, they remained unchanged for many years whilst all around them the user expectations grew and grew.
Many users did not like having to write code, they couldn’t see what the code was going to do, they didn’t know which shortcodes were available and there was little documentation to help them. They wanted a WYSIWYG experience, in line with the rest of the WordPress admin.
One of these users was Fusion, a major multi-platform media company with a rapidly growing online presence via Fusion.net. We were working with Daniel Bachhuber and their development team on a number of tools to support the editorial workflow; to allow their authors to build complex and interesting pages on a daily basis. Out of this collaboration, Shortcake was born.
The drive behind Shortcake was to produce a tool that would satisfy the requirements for Fusion’s editors but would also have a life of its own beyond the project as an open source WordPress plugin. It had to be simple and easy to use, be WYSIWYG, have no coding required, have flexible, reusable modules, be simple for developers to add modules and make use of existing tools.
Time had passed since release 2.5 and with future releases had come more plugins and the possibility to preview more in the editor. MCE views provides a simple Javascript API to register a user interface for a shortcode.
Shortcake combines the existing functionality of shortcodes and MCE views with an interface to create an easier and more versatile user experience. It uses the existing “add media” workflow to allow users to add post elements such gallery, image comparison, embedded pdf, interactive (js apps and games), liveblogs, social streams such as curated Twitter or Instagram content and embedded third party content.
The plugin is available on Github and also as a download on WordPress.org. It has also been approved for use on WordPress.com VIP. Fingers crossed that one day we may even see Shortcake in core, as it has already been included as a WordPress Feature plugin. It is certainly something that the project developers are working towards, one of whom is our own Matt Haines-Young, who has a key role in the project.
So will Shortcake provide a happy ending for shortcodes? Ultimately Shortcake is not all about shortcodes, it’s about the user experience. A happy ending would be the ability for users to add complex blocks of content without ever knowing about shortcodes.
See our Fusion.net case study.
Making shortcodes a piece of cake – Matt’s presentation at London WordPress Big Media and Enterprise meetup.