show_count in wp_dropdown_categories not counting draft posts

I’m using wp_dropdown_categories in the restrict_manage_posts hook to build a filter for the various post_formats.

It works correctly, but it seems to only be counting published posts, and won’t count any posts which are draft.

function _restrict_manage_posts_format()
{
wp_dropdown_categories( array(
‘taxonomy’ => ‘post_format’,
‘hide_empty’ => 1,
‘show_count’ => 1,
‘name’ => ‘p_format’,
‘show_option_none’ => ‘All Formats’,
‘selected’ => $post_format_ID
) );
}
add_action( ‘restrict_manage_posts’, ‘_restrict_manage_posts_format’ );

Is there a better way to render the list that will match the count of posts being returned for each format?

Read more here:: show_count in wp_dropdown_categories not counting draft posts

Leave a Reply

Your email address will not be published. Required fields are marked *