[wp-hackers] WP_Query vs. get_posts

Jeremy Clarke jer at simianuprising.com
Mon Oct 29 22:03:32 UTC 2012

I've never found get_posts to be useful for anything other than avoiding
having to deal with an object (i.e. if someone doesn't know how to use
objects at all, in which case they should take this opportunity to learn ;)

WP_Query is way more powerful and get_posts still does all the work to set
up a WP_Query object before passing you back an array of posts, so there's
no meaningful performance hit.

IMHO get_posts belongs in the useless heap with query_posts(), though it's
not nearly as bad because at least it doesn't stomp on the global query

Jeremy Clarke • jeremyclarke.org
Code and Design • globalvoicesonline.org

More information about the wp-hackers mailing list