Updated answer:
Let’s modify the corresponding dashboard query so it returns no draft posts.
Example:
If I recall correctly the default Hello World post has ID=1
and the default Sample Page has ID=2
.
So if we set ID=2
, then we can remove the draft list, since it is fetching the post
post type.
Since WordPress 4.4 (see #8243) the dashboard_recent_drafts_query_args
filter is available, that makes it easy to target only the relevant query:
/**
* Remove recent post drafts under the Quick Draft on the dashboard
*
* @link http://wordpress.stackexchange.com/a/201910/26350
*/
add_filter( 'dashboard_recent_drafts_query_args', function( $args )
{
// Adjust parameters to your needs to return empty results
$args['post_type'] = 'post';
$args['p'] = 2;
return $args;
} );
Hopefully you can adjust this to your needs, with other parameters if needed.
Another way would be to use $args['post__in'] = [0];
to generate the wp_posts.ID IN (0)
WHERE part. I think I’ve seen this approach in some answers here on this site, but don’t recall where. We get the same result if we use null
, ''
or even false
in place of 0
because it’s taken through absint()
via array_map()
.
This is the result: