A look at WordPress 3.0 custom post types

March 25, 2010 | No Comments Yet

kovshenin.com discusses one of the many new features coming in WordPress 3.0 that will raise its bar as a publishing platform: custom post types.

So what else could be done with WordPress’ Custom Post Types? Well, basically anything. Say you run an online store which of course has some static Pages (such as Contact, About, etc), some blog Posts, cause we’re so 2.0, remember? And Products, which would be a custom post type that contains the product name, description, product price, stock availability, and could even contain inquiries in forms of user comments!

He covers two key code snippets that gets the ball rolling on custom post types: register_post_type (WPEngineer has a great post on it) and custom functions for the edit post screen columns, which are added via a filter and an action:

The action outputs custom columns depending on the type, while the filter simply defines the columns for the Podcasts post type. It’s as simple as that. Note that I trimmed the code a little bit to fit on screen, so you shouldn’t be simply outputing 63:50, but actually count the podcast length 😉

Looks quite simple for those who know their way around PHP, but I expect plugins (and perhaps future releases of WordPress) to integrate interfaces for setting up and customizing post types.

Leave a Comment | Tags: , , , , , , , ,

WPLookup: unofficial function and template tag reference

March 13, 2009 | No Comments Yet

WPLookup is a nifty tool and reference for WordPress designers and developers. It lets you enter a WordPress function or template tag and display the necessary documentation from the WordPress Codex. You can even add it as a search engine to your web browser of choice so it’s just much easier to access.

I can just imagine this becoming an official tool integrated into the WordPress site, and even having an API of sorts so you can plug it into text editors and such. Great potential here.

Leave a Comment | Tags: , , , , , , , ,