#24811 closed defect (bug) (invalid)
get_post_type returns attachment as a searchable post type
Reported by: | unknowndomain | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5.2 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
I don't think get_post_type()
should return the attachment
post type as a searchable post type, because it doesn't show up in the search results.
In other words, this code snippet returns post
and attachment
and I think this is wrong...
$post_types = get_post_types( array( 'public' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'show_ui' => true, 'hierarchical' => false ) );
Change History (3)
Note: See
TracTickets for help on using
tickets.
The post type
attachment
is not registered with'exclude_from_search' => false
, and it can be used in search results too. So this is the correct behavior.