[wp-trac] [WordPress Trac] #11929: Query objects by metadata
WordPress Trac
wp-trac at lists.automattic.com
Sun Jan 17 06:00:57 UTC 2010
#11929: Query objects by metadata
-------------------------+--------------------------------------------------
Reporter: wnorris | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.0
Component: General | Version:
Severity: normal | Keywords:
-------------------------+--------------------------------------------------
Changes (by wnorris):
* cc: wnorris (added)
Comment:
Here is my first stab at this functionality. It returns an array of
objects of the specified meta_type that have the specified
meta_key/meta_value pair. If the value is not specified, it returns
objects that have any value for the specified key.
Retrieving the object IDs is simple. But is that enough? It still leaves
additional work to the plugin author to actually retrieve the object with
the specified ID. I went ahead and added one mechanism for populating the
objects themselves using a new filter. It would work fine in the case
where only a few objects are returned from the query, or where they are
already in the WP cache. However, if a large number of objects are
returned that are not in the cache, the performance is a bit less than
optimal, since each object is populated individually. I'm not sure how
much of a concern that should be.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11929#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list