With all the new API enhancements in the last few versions of WordPress, I thought it was time to give my WordPress Textmate bundle an update, as I first released it exactly a year ago. Here are the things I’ve added:
- Added ‘esc’ tab-expansion: with the help of Mark Jaquith’s great article Escaping API updates for WordPress 2.8, typing
escand then pressing tab now brings up a menu with options to choose the proper escaping function.
- Localization shortcuts, Alt-L now wraps the selected text in a
_e('');function, that translates and outputs the selected text, while Shift-Alt-L wraps it in a
__('');function, which returns the selection.
- A new
widget-tab expansion, which works like this:
<body>tab completion function with the new
body_class();function, for its use, read this great article by Nathan Rice: WordPress 2.8 and the body_class() Function.
author-tab expansion, with the new
the_author_metafunction, with some help from my own PHP Cross Reference and this article: Displaying Author Meta Information in WordPress 2.8
- All functions that are prefixable with
get_, like bloginfo and most functions above, now start with that.
author->tab expands to
get_the_author_metawith the chosen variable, but pressing space or delete immediately removes the
get_part. Neat huh?
- A readme.txt template, including the new changelogs, just type readme->tab in a new file, this snippet uses some shell variables, be sure to enter these in TextMate for quick use.
- A plugin template, open a new file, type plugin and press tab, and you’ll get the option of either adding just the “normal” plugin header, or one with the GPL embedded.
blog->tab now first ask you whether you want general info or RSS info, and the expands into a menu with all the options for each.
- You should also try the
rowtab expansions, they’ve been slightly updated and totally kick ass.
Don’t forget to set the following shell variables in the TextMate config, which you can find under Advanced -> Shell Variables:
I’m very interested in hearing what you would like to see in this WordPress Texmate Bundle, so please leave your requests in the comments!