[TxMt] Fetch post slug (Wordpress)

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


Hi!
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 ;)

P.S.
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:
"%d0%b2%d0%be%d0%be%d0%b1%d1%89%d0%b5-%d1%82%d0%be-%d1%8f-%d0%b6%d0%b4%d0%b0%d0%bb-%d1%84%d1%80%d0%b0%d0%bd%d1%86%d0%b8%d0%b8".
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 :)

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


More information about the textmate mailing list