I have a custom taxonomy register_taxonomy('type', 'blog')
where blog is a custom post type.
When I use wp_dropdown_categories
to create a custom filter, why it is empty?
add_action ( 'restrict_manage_posts', 'filters' );
function filters () {
global $typenow;
if ( 'blog' !== $typenow ) {
return;
}
wp_dropdown_categories (
array (
'show_option_all' => 'All',
'taxonomy' => get_taxonomy ( 'type' )
)
);
}
When I use others like post_tag
or category
then it works, but it’s empty if use my custom taxonomy.