[wp-hackers] Selecting only publicly queryable posts

Gavin Pearce Gavin.Pearce at 3seven9.com
Fri Apr 8 11:30:01 UTC 2011

$args = array('publicly_queryable' => true); 	
$post_types = get_post_types($args);

Use _builtin = false if you don't want the WP builtin post types



-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Robert
Sent: 08 April 2011 12:24
To: wp-hackers at lists.automattic.com
Subject: [wp-hackers] Selecting only publicly queryable posts

Can you select ONLY publicly_queryable posts from a database? (Thanks
everyone for your help on a related topic yesterday).

E.g, some custom post types are non publicly_queryable.

I need to select all posts in the database that are of a post_type that

I can run that, if I can figure how you generate a list of the publicly
queryable post types? Any ideas?

Thanks as ever!

wp-hackers mailing list
wp-hackers at lists.automattic.com

More information about the wp-hackers mailing list