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. :)

Filed Under

  • Open Source, PHP

Related Posts

  • WordPress Search Engine Spam
  • WordPress BBCode Plugin
  • Upgraded to WordPress 1.2
  • Upgraded to WordPress 1.5
  • The Problem with Markup Languages
Both comments and pings are currently closed.

8 Responses to “A WordPress bug fix”

  1. Bjorn_Iceland says:
    12/3/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. Jeff says:
    12/3/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. wordpress quickstart guy says:
    8/12/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. LkM says:
    9/2/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 ?

  5. Kali Giesbrecht says:
    1/10/2012 at 5:10 am

    very good! i like this article!

  6. Maximo Caoagdan says:
    1/11/2012 at 6:44 am

    Akismet Plugin together with other Plugin Opportunities for WordPress

  7. Malcolm Kinnon says:
    2/8/2012 at 11:43 pm

    I truly like what you guys are frequently up too. This sort of clever function and reporting! Keep up the incredible works guys I’ve incorporated you guys to my own blogroll.

  8. go learn web98. says:
    3/13/2012 at 7:30 pm

    [...]The information mentioned in the article are some of the best available [...]……

    [...]The information mentioned in the article are some of the greatest available [...]……

    Subscribe Feed
    Share Subscribe to this blog…
    Share Bookmark or share this page…
  • About

    My name is Jeff Moore. I'm a PHP programmer living in San Francico and working for a startup.

    More about me…

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (18)
    • Open Source (14)
    • PHP (99)
    • Software Design (29)
    • Usability (14)
    • Web Design (20)
  • Recent Comments

    • rsync to remote server via ssh  37
      Petr Halounek, Penni Tomasino, Rodney Kohnen [...]
    • WordPress BBCode Plugin  30
      wepniveth, Pamella Philipps, evakuat [...]
    • PEAR Templates  18
      Sang Bellotti, Kandice Sansing, car insurance estimates for teenagers [...]
    • Extreme Simplicity  15
      Gilbert Moatz, Roni Beauregard, Barb Geyer [...]
    • Manual Memory Management is Dead  6
      Grass Fed Filet Mignon, Kellie Carello, PAPANDOR [...]
    • Friendster wrapup: does MySQL scale  38
      Ollie Joya, nfl jersey on sale, selling scrap gold [...]
    • The Coding Apprentice  51
      fkawau, Annamae Mccane, Boca Raton Personal Injury [...]
    • The Legality of Republishing RSS Feeds  30
      dasfdsfsd, reebok authentic nfl jersey, Tory Rennemeyer [...]
    • Exceptional PHP  7
      Sports, The Click, Laraine Waterhouse [...]
    • PDO versus MDB2  42
      selling silver coins, Oliver Luongo, ddkoaorpa [...]
  • Recent Posts

    • Richard Thomas
    • ZendCon: Writing Maintainable PHP Code
    • Looking Towards the Cloud
    • Holiday Tech Support
    • Closures are coming to PHP
    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
  • Site

    • Archives
    • Log in
  • Search