Jump to content

Wordpress shortcodes

Recommended Posts

I have trouble remembering the format of several Wordpress shortcodes that I use quite often, so I made an Alfred extension for it. In case it's of any use to anyone else, here it is.
What it does
It will paste a sample Wordpress shortcode into the current document/browser window.
Note: I haven't explored the new workflow options enough to know if it would be possible to take the input from Alfred, but if I can figure that out (or someone gives me some pointers), I'll update this workflow.
How to use it
To use, type "wp service-name" into Alfred, for example wp soundcloud will paste an example [soundCloud] shortcode:

[soundcloud params="auto_play=true&show_comments=false" url="http://api.soundcloud.com/tracks/207988" iframe="true"]

I've included most of the "stock" short codes available with Wordpress, but you'll get the most benefit out of this if you add your own (I've tried to keep the process for doing so as simple as possible).
Adding new shortcodes
To add a new shortcode, edit the file "shortcodes.php" in the workflow's folder and add a line such as:

$shortcodes[]=array("title"=>"My Shortcode", "description"=>"do something awesome", "code"=>'[my-shortcode parameter="123"]');

If you want to edit (or remove) any of the sample shortcodes I've included, see the file "defaults.php"

Bonus feature: I've allowed for the possibility of using an icon for specific shortcode, if you want to do this, put the icon image file inside the workflow folder and change the code like so:

$shortcodes[]=array("title"=>"My Shortcode", "description"=>"do something awesome", "code"=>'[my-shortcode parameter="123"]', "icon"=>"my icon.png");


Source: https://github.com/surrealroad/alfred-wordpress-shortcodes

Monday, 18 March 2013: first version.

Edited by surrealroad
updated download link
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...