>
Download This Plugin | |
Download Elegant Themes | |
Name | Things |
Version | 0.1 |
Author | mitcho (Michael Yoshitaka Erlewine) |
Rating | 0 |
Last updated | 2012-02-26 12:10:00 |
Downloads |
293
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Things plugin added 16 bytes of resources to the Home page and 20 bytes of resources to the sample Post page.
Things plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Things plugin ads no tables to your Wordpress blog database.An object-oriented approach to WordPress queries and custom post types. Un(der)documented beta.
So, here's the idea: anywhere where you need a loop, use get_things()
, which will return an array-like collection of Things. get_things()
will return Things from the main query; get_things($query_args)
will run a new query for you. Each Thing in the collection is a magical object that will make your life better.
foreach ( get_things() as $thing ):
// get an attribute (object or string)
$author = $thing->author;
// echo an attribute with the_* methods
$thing->the_title();
// get another Thing
$parent = $thing->parent;
endforeach;
Each Thing automatically has properties and associated the_*
methods for the standard WordPress data and taxonomies associated with that post type. Meta (custom field) properties are created when you specify meta
in your custom post type arguments. If you want to add custom methods or properties, create a subclass of Thing
and register that with a particular post type.