[TxMt] Fetch post slug (Wordpress)

Alexey Blinov nilcolor at gmail.com
Wed Nov 21 18:08:22 UTC 2007

Recently i was pointed that i can use a "slug" keyword to tell
blogging bundle to set post slug. And it was fine with one minor
problem - Fetch Post command doesn't fetch that slug... It even
fetches tags (keywords) for WordPress 2.3 but no slug. So I decide to
try to tune blogging bundle for myself. And it was not very hard. Here
is a result (blogging.rb file, line 405 aprox.):

    doc += "Title: #{self.post['title']}\n"
    #added: this line will populate slug back to post
    doc += "Slug: #{self.post['wp_slug']}\n" if self.post['wp_slug']
    doc += "Keywords: #{self.post['mt_keywords']}\n" if self.post['mt_keywords']

I tested it only with Wordpress 2.3 (i use it) so try it with care ;)

Why I need it? I often use post headers like "Вообще-то, я ждал
Франции..." (russian) and then set a slug like "waiting-for-france".
And sometimes i edit my post and forget to write slug again. And post
slug become something like this:
Plus from this point i can't send link to my friends (that didn't so
happy to own Mac) becouse Safari shows it like
"http://nilcolor.prosound.fm/2007/11/21/вообще-то-я-ждал-франции/" -
yep, with pure russian chars in address bar :)

Hope this change or better one will be implemented asap in svn copy of
blogging bundle.

More information about the textmate mailing list