Get count of custom post type created by current user

I’m trying to get the count of published posts in a custom post type for the current user (to display on a profile page). I found this here on the forums: <?php global $wp_query; $curauth = $wp_query->get_queried_object(); $post_count = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->posts WHERE post_author=”” . $curauth->ID . “” AND post_type=”user_video” AND post_status=”publish””); ?> But, … Read more