[wp-trac] [WordPress Trac] #18950: get_post_types() does not return post-types registered with verbose alternatives of the $public argument

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 18 02:48:25 UTC 2012


#18950: get_post_types() does not return post-types registered with verbose
alternatives of the $public argument
-------------------------------+------------------------------
 Reporter:  fireproofsocks     |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Post Types         |     Version:  3.2.1
 Severity:  major              |  Resolution:
 Keywords:  close 2nd-opinion  |
-------------------------------+------------------------------

Comment (by fireproofsocks):

 Sounds like you're confusing show_ui and publicly_queryable.  Here's my
 understanding of all these attributes:

 * *show_ui*: the post-type will be visible in the WP admin interface (hard
 to imagine a case where you wouldn't set this to true)
 * *publicly_queryable*: visible on the front-end via a request.  I.e. ANY
 request.
 * *exclude_from_search*: controls whether posts in this post-type show up
 in search results.
 * *has_archive*: whether posts of this post-type show up in archives.

 So the "public" attribute here remains vague.   Even if we add more
 attributes to define even more behavior (e.g. show in RSS feed, etc.),
 everything I've seen about the topic means that YES, when people query on
 the public argument, YES they SHOULD have queried on a different
 attribute, but I think most of the time, they probably meant
 publicly_queryable.

 So that's EXACTLY the problem: people are just blindly searching for
 "public" post-types and they don't necessarily know what they mean.  So
 that's why I filed this in the first place: so if smarter folks query on
 publicly_queryable, then the query will return post-types that were
 registered using the short-hand "public" attribute and VICE VERSA: if
 smarter folks registered their post-types verbosely with all attributes,
 then a simpler query searching for the vague "public" post-types would
 also pull up post-types that were registered using 'publicly_queryable'
 set to true.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18950#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list