Description
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.
Screenshots
FAQ
- 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.
Reviews
Very nice plugin for astropay kart
i using this plugin for my astropay kart web site. If you wanna see my web site : http://astropayal.org you can visit.
Straightforward
Straightforward, easy to use, easy to understand when one checks the source code. Better documentation wouldn't hurt. Anyway five of five thanks.
Changelog
0.7.0 (November 18, 2016)
- Adds “Add post element” button to media buttons – one click to open the shortcode list, rather than clicking “Add media” button and then finding “insert post element” in the menu.
- Added “Term Select” field type.
- Added “User Select” field type.
- Added new hooks that fire on rendering/editing/closing a shortcode, which can be used for field types which require custom javascript initialization or cleanup.
- Select fields: add full support for multiple select fields.
- Select fields: support custom ordering of options.
- Select fields: support grouping option in
<optgroup>s by passing them as a nested array. - Attachment fields: support multiple selection.
- Attachment fields: support SVG images (if svg uploads are enabled by a plugin or theme).
- Bug fix: Handle percent signs when decoding fields with
encode=truespecified. - Bug fix: fix issue where it takes two clicks on a shortcode in editor to bring up the Edit Shortcode modal.
- Bug fix: fix issue when searching for shortcodes by name where if multiple shortcodes start with the search string, only the first is returned.
- Bug fix: only output a description field on an attribute if it’s not empty.
- Compatability: Remove shims for handling the media modal in WP 4.1 and 4.2.
- Compatability: Upgrade Select2 library to 4.0.3 to avoid conflicts with other plugins which use the latest version of Select2.
- Added Turkish translation.
- Added Finnish translation.
- Added Swedish translation.
- Added Hungarian translation.
0.6.2 (November 12, 2015)
- Bug fix: Listens for “change” event on radio buttons and checkboxes to ensure shortcode attributes are updated.
- Bug fix: Ensures
register_shortcode_uiis always run before calling get_shortcodes(). Fixes post select AJAX callback when usingregister_shortcode_uihook.
0.6.1 (November 9, 2015)
- Fixes JavaScript TypeError when clicking media frame menu items.
- Corrects links in readme.
0.6.0 (November 2, 2015)
- Supports an optional
encode=trueargument for attributes, to allow limited HTML support. Attributes need to be run throughshortcode_atts()in order to be properly decoded. - Defines a
SHORTCODE_UI_DOING_PREVIEWconstant when rendering a shortcode preview, which enables callbacks to serve a different representation of the shortcode in TinyMCE. - When an attachment is already selected for a shortcode attribute, opening media library will include it selected.
- Cleaned up icon vertical alignment in the Insert Post Element UI.
- Added CSS utility classes to all field HTML. For instance, the attachment field is now wrapped with
shortcode-ui-field-attachment. - Added filters to modify shortcode UI arguments on registration.
- Cleaned up the example plugin, so it’s a much more useful developer reference.
- Uses core’s JavaScript regex for parsing shortcodes, instead of maintaining separate regex.
- Permits HTML in field labels and descriptions.
- Added Danish translation.
- Added Italian translation.
- Added German translation.
- Core integration: Fully supports PHP 5.2.
- Bug fix: Persists shortcode attributes and inner content when there isn’t UI registered for them. Previously, they would be discarded.
- Bug fix: Display the description on the post select field.
- Bug fix: Attribute field change event binds to
inputevent rather thankeyup. - Full release notes
0.5.0 (August 26, 2015)
- Attachment field: Made it easier to change the attachment by clicking on the thumbnail; added attachment metadata in the field view.
- Attachment field: Refactored JavaScript to trigger events.
- Added a
rangeinput type. - Introduced a
register_shortcode_uihook for plugins to more safely register UI with. - Removed Preview tab to bring Shortcake’s user experience closer to Core, in which the inline visual preview is preferred over a separate preview in the media modal.
- Cleaned up JavaScript using JSHint.
- Added Russian translation.
- Added Portuguese translation.
- Added PHPDoc to all classes.
- Bug fix: Persists
inner_contentfor a shortcode even when UI isn’t defined. - Bug fix: Hitting esc in a Shortcake view will now close the modal. (Fixed in Core.)
- Bug fix: Hitting delete when a Shortcake preview is selected in the Visual editor now results in the shortcode being removed. (Fixed in Core.)
- Bug fix: The Shortcake ‘search’ function no longer visually conflicts with the shortcode grid at small screen sizes. (Fixed in Core.)
- Bug fix: Use
get_post_type()instead ofget_current_screen()->post_typeso context is properly set on the frontend. - Full release notes
0.4.0 (June 22, 2015)
- Using carldanley/wp-js-hooks for a basic API to register JS callbacks on shortcode attributes.
- Attachment field uses a loading indicator when the preview for an attachment is loading.
- Added Chinese translation.
- Added French translation.
- Added Spanish translation.
- Bug fix: Prevents fataling when editor is loaded in the frontend context.
- Bug fix: Color field also supports
metaargument. - Bug fix: Removes trailing whitespace from shortcodes without attributes.
- Bug fix: Removes double slash in editor css path.
- Full release notes
0.3.0 (April 27, 2015)
- Breaking change: We’ve removed the compatibility shim for the magical
contentattribute. If you were using this to support editing inner content, you’ll need to change your UI registration to useinner_content. - New
post_selectfield type for selecting from a list of posts. Supports an additionalqueryparameter to modify the search query. - Using a new
post_typeargument, 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
metaargument can be specified to add arbitrary HTML attributes to the field. We’ve added a compatibility shim for the existingplaceholderargument. 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.
- Language around the editing experience reflects the shortcode you’re editing. For instance, with a pullquote shortcode, “Edit Post Element” becomes “Edit Pullquote”.
- Added Dutch translation.
- Source JavaScript files moved to
js/srcfor clarity between source and built JavaScript. - PHP files are scanned using PHP_CodeSniffer.
- Bug fix: Unquoted shortcode attributes are properly supported.
- Bug fix: Attachment field properly registers dependencies.
- Bug fix: “Insert Post Element” experience should work when visual editor is disabled. Shortcake is only loosely coupled with TinyMCE.
- Bug fix: Editor styles are loaded on
after_setup_themeto prevent fatals. - Full release notes.
0.2.3 (April 8, 2015)
- Fix WP 4.1 backwards compatibility issue by restoring arguments passed to TinyMCE view compatibility shim.
0.2.2 (April 6, 2015)
- Update arguments passed to TinyMCE View Render for WP 4.2 compatibility. Previously passed argument wasn’t necessary, so removing doesn’t break backwards compatibility.
0.2.1 (March 18, 2015)
- Ensure use of jQuery respects jQuery.noConflict() mode in WP.
0.2.0 (March 18, 2015)
- JS abstracted using Browserify.
- Enhancements to “Add Post Element” UI: shortcodes sorted alphabetically; search based on label.
- Much easier to select shortcode previews that include iframes.
- WordPress 4.2 compatibility.
- Added color picker to list of potential fields.
- Bug fix: IE11 compatibility.
- Bug fix: Checkbox field can now be unchecked.
- Full release notes.
0.1.0 (December 23, 2014)
- Supports all HTML5 input types for form fields.
- Shortcode preview tab within the editing experience.
- Re-labeled the UI around “Post Elements”, which is more descriptive than “Content Items.”
- Many bug fixes.
- Full release notes.
Contributors & Developers
This is open source software. The following people have contributed to this plugin.
Benjamin Intal
Bronson Quick
Daniel Bachhuber
dashaluna
davisshaver
Frederic Serva
fusionengineering
Gary Jones
goldenapples
jitendraharpalani
Stanislav Khromov
Thomas Kräftner
Matthew Haines-Young
Daniele Scasciafratte
pravdomil
Robert O'Rourke
Scott Kingsley Clark
zebulonj





