This entry is part 7 of 14 in the Plugin Development 101 Series
- Introduction to WordPress Plugin Development 101
- Plugin Development 101 – What Makes a Plugin?
- Plugin Development 101 – General Best Practices
- Plugin Development 101 – An Intro to Filters
- Plugin Development 101 – Intro to Actions
- Plugin Development 101 – Registering a Custom Post Type
- Plugin Development 101 – Intro to Short Codes
- Plugin Development 101 – Intro to Loading Scripts and Styles
- Plugin Development 101 – Introduction to Adding Dashboard Menus
- Plugin Development 101 – Separating Your Plugin into Multiple Files
- Plugin Development 101 – Your First OOP Plugin
- Plugin Development 101 – Dissecting the Featured Comments Plugin
- Plugin Development 101 – Digging Into WordPress Core to Solve a Problem
- Plugin Development 101 – Introduction to extending classes
The WordPress short code API is one that plugin developers use a lot. Short codes are used for kinds of things: gallerys, related post lists, purchase buttons, alert messages, etc. Whether your plugin uses them or not, every single plugin developer will write at least one short code. This part of Plugin Development 101 will walk you through how to create short codes in your plugins.
Good intro for shortcodes. Just one question is there any way to go back in the video? If I miss something it seems like I have to watch the whole video again.
At the moment, no. It’s a really bad UX element that I’m going to try and fix asap.
Pippin, PLEASE do something about the videos! I can’t see any of the ones in this series past a few minutes 🙁
Love the site! Your explanations are excellent.
What happens? Do they stop playing? Are they not loading all the way?
Hey Man Im working on two monitors on my mac, your videos on one, Sublime on the other. Problem is unlike your You Tube Videos the full screen option in this series takes my whole system full screen rendering my other monitor useless. Time to Fire Up the laptop… Maybe Im being retarded. Any Ideas?
Thanks,
Wade
Ok that was only happening with Chrome, Switched to Safari and Firefox all good.
Sounds like a minor compatibility issue with Sublime Video and Chrome.
Loving all the videos Pippin! However, as stated before, the video player is really slow and I’ve noticed when I exit from full screen mode, the video stops and start buffering again…
Anyway, here is a player I use on my site and it’s fantastic. I load the video files from S3, not sure if you buy other developers’ plugins, I found this one on codecanyon.
http://codecanyon.net/item/chameleon-html5-video-player-for-wordpress/3670384
Hope it helps.
Thanks for the note. I’m hoping to get the videos moved to a better system next week or shortly after.
Pippin, I can’t watch nether this video nor any other after this one…
I watched all the previous videos last night and they were running ok, and they still are.
At the place where should be the video about short codes, there is an image with you logo and a play buttom, but when I press it, a buffer bar is shown but nothing happens. Is there some other way to access these videos?
Thank you!
Try now.
Now this video is working. Thanks!
But none of the others (after this one) is working yet…
I’m in the process of moving all of the videos over to a better system. The ones that are working for you are the videos that have been moved.
I’m hoping to have the remaining videos moved over by sometime next week.
Hi Pippin,
Thank you for this great series I am just getting into it 🙂
Two questions, should shortcodes have a prefix as well? To eliminate chance of two shortcodes with same name being registered? If so, should they by hyphenated or underscored?
Second, do you cover, or could point me to tutorial on how people add the buttons above the editor to insert shortcodes that popup the window and accept parameters?
Thank you.
1. It really depends on the short code. There are many times of short codes that are (or should be) designed to carry across plugins and themes, such as column short codes. Other short codes should be more unique. If your short codes are unique and not something another plugin will have, a prefix is fine and a good idea.
2. I have a really old tutorial on it and it’s definitely partially out of date, but it could help you get started: http://www.problogdesign.com/wordpress/user-friendly-short-codes-with-tinymce/
User note: I copied the example provided in the video and for the life of me could not get it to display. I then deleted Pippin’s example (sorry!) and used the similiar one in the WP codex and it displayed properly. I then deleted all the WP supplied information in the WP example and had just a shell. I then filled the shell with the information taken from Pippin’s example and it worked.
Sometimes copy and paste leads to stray (sometimes invisible) characters getting included that makes it not work.
Glad to hear you got it!
I have a really hard time seeing what you’re doing because of the black background (when you’re editing the plugin).
Hey Doug,
Thank you for the feedback. I will certainly keep that in mind for future videos.
If you have any questions about it, I’ll be more than happy to address them.