Geeky bits in WordPress 2.9

Thanks to Peter Westwoord's WordPress Beta Tester plugin, this blog is on the 2.9 development track again, after having been off trunk for a couple of months. That plugin makes it really easy to switch any WordPress install to the development branch, either for the next "point" release (eg. 2.8.6), or the next major version, in this case, 2.9.

Check out Technosailor's great post on most of the new features for users. Below I've gathered a list of things especially relevant for readers of this blog and for developers like myself.

Support for rel="canonical"

WordPress now has rel="canonical" support built in, there by making my Canonical URL's for WordPress plugin obsolete, as expected.

Enhancements to wp_query

Although this is more for the geeks, I'd been fighting this one for a while now without realizing it: you could only get $wp_query to either return one type of post (so 'post', or 'page' or 'attachment') or ANY type of post, but not all posts and pages. You can now, IMHO, that's a major improvement.

Performance updates to options table

It's a long story, but if you like databases and optimization, this thread on Trac is worth a read. In short: the options table is now more optimized than it was before.

Upgraded TinyMCE

Highlights of that upgrade (here's the Trac ticket):

  • Empty P tags are not stripped off and would show in the HTML editor as <p> </p>
  • The paste and paste from Word cleanup removes spans and inline styles.

Option to cache wp_remote_get

This might be one of my most favourite simple enhancements. It allows wp_remote_get requests to be cached, very useful, might even be worth adding into a plugin like Frederick's W3 Total Cache.

category-<slug>.php support

This one will be loved by theme coders all around. You can now make a category-<slug>.php template, where before you always had to make a category-<id>.php template. This one is a lot more intuitive. Incidentally, support for tag-<id>.php templates was added too.

Another major improvement in that area is that you can now make page-<slug>.php templates, so if the slug is sitemap, page-sitemap.php would always be it's template. Nifty, huh?

Post thumbnails

Though best explained in the the post on Technosailor, you should try adding this to your themes functions.php file:

if ( function_exists( 'add_theme_support' ) )
	add_theme_support( 'post-thumbnails' );

It will add a meta box to your Write screens:

When clicked this will simply bring you to your Media Gallery and add a new link next to insert into post entitled "Use as thumbnail":

Use as thumbnail

The image you select there can then be used with the new functions has_post_image(), get_post_image_id(), the_post_image() and get_the_post_image().

That's a pretty cool addition for theme developers, together with the media additions, which also allow you to change just the thumbnail, this makes for a pretty decent post thumbnail feature set.

Sidebar descriptions

This new feature allows you to add a description to each sidebar in your theme. If you, like we do very often at OrangeValley, create themes with 10 or more sidebars, that really is a nice feature. It's very simple too, all you have to do is add a description value to the array you're using to declare sidebars:

if ( function_exists('register_sidebar') ) {
  register_sidebar(array(
    'name' => 'Complex Sidebar',
    'id' => 'complex',
    'description' => 'Here is some important considerations about Complex Sidebar',
    'before_widget' => '<li id="%1$s" class="widget %2$s">',
    'after_widget' => '</li>',
    'before_title' => '<h2 class="widgettitle">',
    'after_title' => '</h2>',
  ));
}

And it'll look like this:

sidebar description

There's tons more new cool stuff, but this should get you started for now!

30 Responses to “Geeky bits in WordPress 2.9”

  1. I've got a question for you Joost.

    Is about w3 total cache plugin.

    What do you think is better w3-total-cache or WP Super Cache ?

    I've been reading from both and actually im using WP Super Cache.

    Waiting for your opinion.

    Thanks

  2. Very very cool geeky stuff. :D I'm especially excited about the options table & sidebar descriptions.

  3. Can't wait.. Specially the category-slug.php will help us so much, because nobody can ever remember what ID the category you want to edit has..
    Great summary, thanks.

  4. Good job on that! Can't wait to see it walking and roaring! :) Best regards

  5. W3 Total Cache, hmm I been using Super Cache and really have not noticed much improvement.

    Time for a change,, thanks for the great tips.

  6. So much about this post has me chair-dancing. Thanks -- great features, and so well explained! I really enjoy your blog and your plugins.

  7. I'm still using Super cache and was reading some tutorial shared by people on super cache vs w3 cache
    Wondering unlike supercache (apart from .htaccess) , do we need to do anything to configure w3 cache?
    And any thing in particular which w3 is missing?

  8. Thanks Joost, I'm finally starting to get excited about about the new release...I'm just still terrified about how all of this is going to impact my existing mission critical plugins and themes. I see a careful "Effected Plugins" chart in my future and many many many trips to the forums before I hit the upgrade button.

    The slug templating options are rockin' though, can't deny that'll make my limited-themes-on-WPMU life easier.

  9. The post types specified in the query is a small revolution in WordPress, one step closer to use as a CMS.

    Management miniatures is also a huge bonus.

    With the v.3 and the pooling of MU, the other CMS's will struggle to keep the comparison.

  10. Super list of "Geeky bits" Joost, thanks for taking the time to publish it.

  11. the category- and tag- additions just perked up my day a little bit! As well as the thumbnails... I've been trying to put together an RSS feed from wordpress that will pull an image, maybe this'll help! (Although if anybody can point me in the right direction, I'd be eternally grateful)

    And there's so many other interesting things i can't wait to try out the new release!

  12. I found your blog today and just wanted to stop by to thank you for your high quality content.
    You just got a new reader ;)

    Coty.

  13. WordPress now has rel="canonical" support built in, there by making my Canonical URL's for WordPress plugin obsolete, as expected.

    You are wrong with this, WordPress adds rel="canonical" only on singular pages and not on home page, archives etc. See here.

    • But you need to assign canonical URL only to the singular pages, ie, to the individual post and page. Essentially singular pages are the ones that cause confusion to the search engines in view of multiple URLs pointing to the same page.

      Archives and blog pages (home) are merely derived (and aggregated) rendering.

      S.K

  14. Somebody know when we can have the stable 2.9 version ?

  15. Hi guys

    I just also Switched over to w3 total cache plugin,and it was great! What an improvement against wp super cache. I'm now getting excited for new release.

    Kind Regards
    Sam
    X

  16. I never thought that I would learn about a new plugin while reading comments. I'll try out "w3 total cache plugin" as recommended. It is because I'm having trouble with the other cache plugin.

    Anyways, I hope the new version of wordpress would already include an option to cache the files, so that we won't be needing plugins for that.

  17. Awesome list of the geeky changes in the new upcoming wordpress 2.9, and not to forget i learnt a lot from comments too.

  18. Hey Joost. A 2.9 question - thought it'd be good here. I'm launching a new blog soon and a plugin I want to use is only valid on 2.9. How long would you recommend waiting until using 2.9 on a production site?

Comments closed, if you feel you have something to say:
drop me a line.

15 Trackbacks to “Geeky bits in WordPress 2.9”

  1. Wordpress Nyheder | Wordpress Tips - Wed, November 25th, 2009 at 22:20
  2. links for 2009-11-26 | Links | WereWP - Thu, November 26th, 2009 at 15:03
  3. SOS Weekly Recap in Search 11/23/09 | StayOnSearch - Fri, November 27th, 2009 at 16:15
  4. Geeky Bits To WordPress 2.9 - WordPress Tavern Forum - Sat, November 28th, 2009 at 22:53
  5. Irregulier » Quelques nouvelles, rien que pour vous - Sun, November 29th, 2009 at 14:14
  6. What Fun Geeky Things Are Coming in WordPress 2.9? - Thu, December 3rd, 2009 at 12:55
  7. December Meetup Follow-up « Wordpress Harrisburg - Thu, December 10th, 2009 at 18:13