Sounds very simple as querying for posts and iterating through the results and working with the post status.. Just make sure to add 'post_status' => 'any'
to the query args so as to include more statuses beside the published:
$args = array(
'author' => 1, // user ID here
'posts_per_page' => -1, // retrieve all
'post_type' => 'post', // post type (change to your PT)
'post_status' => 'any' // any status
);
$posts = get_posts( $args );
$drafts = $pendings = $published = array();
if ( ! empty( $posts ) ) :;
foreach ( $posts as $post ) {
switch ( $post->post_status ) {
case 'draft':
$drafts[] = $post;
break;
case 'pending':
$pendings[] = $post;
break;
case 'published':
$published[] = $post;
break;
default:
break;
}
}
endif;
echo var_dump( 'drafts', $drafts, 'pending', $pendings, 'published', $published ); // or print_r
Hope that helps.
This will be used for a rule. If a user has more than or equal to X
number of posts on a post type, they will see a customized text.
An example usage: if ( count( $drafts ) >= (int) X ) { # Hey!! }