Opened 15 years ago
Closed 15 years ago
#13150 closed defect (bug) (worksforme)
get_posts( post_type=x & custom_tax=y ) ignores the custom post type
Reported by: | bobsoap | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Posts, Post Types | Keywords: | custom post type, custom taxonomy |
Focuses: | Cc: |
Description
When calling get_posts with both a custom post type and a custom taxonomy, all posts that are attached to that taxonomy are returned, regardless of the post type.
Example:
//the taxonomy register_taxonomy( 'genre', array('movies','genre_descriptions'), //attach to 2 objects array( 'hierarchical' => false, 'label' => 'Genre', 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => ''), 'singular_label' => 'Genre' ) ); //trying to get only the genre descriptions for a genre get_posts('post_type=genre_descriptions&genre=my-genre&status=publish&posts_per_page=-1') //returns all posts with the genre "my-genre", even when they are not a "genre_descriptions" post type
WP 3.0 beta 1
Change History (2)
Note: See
TracTickets for help on using
tickets.
Maybe it is this 'status=publish'
This works for me
If that doesn't resolve it, also there was ticket:13020 last week -- have you updated to the latest nightly?