according to the codex get_post_types accepts a taxonomies parameter, but it isn’t explained exactly how this works. i thought that it would return the post type this taxonomy is registered to, but that doesn’t seem to be the case.
$post_args = array( 'public' => true, 'taxonomies' => array('genre'), 'show_ui' => true ); $post_types = get_post_types($post_args);
when i print out the $post_types variable, i get both posts and my custom post type to which the genre taxonomy is registered. So I am wondering if it is possible to have get_post_types only the post type associated with the taxonomy argument.. or at least explain how this parameter is supposed to work.
- The topic ‘get_post_types returns more than expected’ is closed to new replies.