Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.
« Changes to my blog (and feeds)
Why isn’t PHP the natural successor to Java? »

A WordPress bug fix

September 27th, 2005

I upgraded WordPress to 1.5.2 this weekend. This version fixed some bugs that made it necessary to edit WordPress itself in order to get my BBCode plugin to work. That editing is one reason I put off upgrading for so long. I am grateful that my plugin can now exist on its own. (I’ll release a new version in a few days.)

Unfortunately, this version of WordPress introduced one bug that really annoys me. Pingbacks and Trackbacks aren’t using the permalinks, but instead using ugly query string links.

A little greping suggests that this is caused by a cache that becomes stale after a post is updated. So, I think the solution is to insert this line:

 
unset($post_cache[$post_ID]);
 

on line 382 of wp-admin/post.php.

Since this post contains a link to another blog post, which should get a pingback, it will be my public test of the theory.

UPDATE: Bug fixed. :)

categories Open Source, PHP
tags blogging, wordpress

Related Posts

  • WordPress Search Engine Spam
  • WordPress BBCode Plugin
  • Upgraded to WordPress 1.2
  • Upgraded to WordPress 1.5
  • The Problem with Markup Languages
You can leave a response, or trackback from your own site.

4 Responses to “A WordPress bug fix”

  1. #1 Bjorn_Iceland responds...
    December 3rd, 2005 at 6:48 am

    Jeff,

    Looking forward to your new release of the BBCode plug-in for WordPress 1.5.2/6.0.

    Did you submit a patch/entered a ticket for this ‘unset($post_cache[$post_ID]);’ issue over at WordPress.org so the fix makes it into a future release?

    Best,
    - Bjorn

  2. #2 Jeff responds...
    December 3rd, 2005 at 10:01 am

    There was already a bug report for this bug on the tracker and I think I submitted the fix as a comment on that bug, but I no longer remember exactly what I did. I’ll check and see if the new beta still has the bug.

  3. #3 wordpress quickstart guy responds...
    August 12th, 2007 at 10:31 pm

    hi jeff,

    i found your page on the search engine and you’re a real guru in wordpress. Wow, you started blogging since 2004?

  4. #4 LkM responds...
    September 2nd, 2007 at 4:56 pm

    Hello buddy :)

    I’m making some tests with WordPress and found your great plugin BBCode…

    Do you have plans to update this Plugin ?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

code: use [code=php][/code].

Comment Preview

  • Search

  • Subscribe

    Subscribe All Posts
    Subscribe All Comments
    Subscribe All Bookmarks
    Subscribe with Bloglines Subscribe with My Yahoo Add to netvibes Subscribe in NewsGator Online Add to Google
  • Share This

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (16)
    • Open Source (14)
    • PHP (95)
    • Software Design (28)
    • Usability (14)
    • WACT (7)
    • Web Design (20)
  • Recent Comments

    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  94
      noujoum, Michiel Van Kets, isorabins [...]
    • Sarah Snow Stever  24
      Dubai Web Design, Development, Snowcore, ennah [...]
    • Benchmarking PHP's Magic Methods  8
      stas, minikperi, Shelon Padmore [...]
    • Keywords and Language Simplicity  7
      olmse, Handy, minikperi [...]
    • Even the Big Guys Get Validation Wrong  4
      James Benson, Michael, Enric Naval [...]
    • Improved Error Messages in PHP 5  12
      James Benson, Iron, baggreeddog [...]
    • How to Transfer Mac OS X Application Data between Computers  36
      Secret Santa, micala, Khaled bin Alwaleed [...]
    • Programming Language Trends via Google  15
      MattW, Jeff Davis, retry [...]
    • PHP Development From Java Architects Eye  10
      Grrkkvho, Bobrila, FelhoBacsi [...]
    • The value of MVC  9
      Euvmetkk, Bobrila, Vulchak [...]
    • nofollow and comment spam  5
      Scopmazo, Qmumqckx, sss [...]
  • Pages

    • Tags
  • Recent Posts

    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)
    • Keywords and Language Simplicity
    • Improved Error Messages in PHP 5
    • Michigan Taxes Graphic Design Services
    • Ruby versus PHP or There and Back Again
  • Archives

    • 2008: May
    • 2007: Jan Feb Mar Apr May Sep Oct Nov
    • 2006: Jan Feb Mar Apr May Jun Jul Oct Nov Dec
    • 2005: Jan Feb Mar Apr May Sep Oct Nov Dec
    • 2004: Apr May Jun Jul Aug Sep Oct Nov
  • Menu

    • Register
    • Log in