Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#24811 closed defect (bug) (invalid)

get_post_type returns attachment as a searchable post type

Reported by: unknowndomain Owned by:
Priority: normal Milestone:
Component: Posts, Post Types Version: 3.5.2
Severity: normal Keywords:
Cc: Focuses:

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)

#1 @toscho
13 years ago

  • Cc info@… added
  • Keywords close added

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.

#2 @ericmann
13 years ago

  • Resolution → invalid
  • Status new → closed

#3 @helen
13 years ago

  • Keywords close removed
  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.