It's Friday, it's late, I've probably done this before in the work I've done before, but I'm drawing a blank. What is the best way to stay within the Wordpress framework and collect a list of your custom post types?
This is being used in the admin side and the code exists inside a plugin. I've got a custom post type, though this should be the same question for regular posts.
Essentially, I want a pulldown which has all of the posts (under a custom post type) sorted by a person's name. The tough part, the name is stored as a custom post meta (custom field). I could simplify things and make the post title (currently ignored and unused) be the person's name.
There is no relevant code to supply, this is just a general question aimed at fellow plugin developers.
Is there a function that collects posts in to an array or object?
get_posts
andWP_Query
allow fetching based on meta and post type, and additionally both return an array of objects. So essentially your answer would be to call one of those with the applicable args. Unless you feel there's something they don't provide that you need(but is missing from your question). – t31os Dec 24 '11 at 12:56