You can get a little more fancy, but this should get you started.
add_action( 'right_now_content_table_end', 'wpse_3809');
function wpse_3809() {
$types = get_post_types( array( '_builtin' => false ) );
foreach( $types as $type ) :
$num_posts = wp_count_posts( $type );
$num = number_format_i18n( $num_posts->publish );
?>
<tr>
<td class="first b b_<?php echo $type; ?>">
<a href="https://wordpress.stackexchange.com/questions/38098/edit.php?post_type=<?php echo $type; ?>"><?php echo $num; ?></a>
</td>
<td class="t <?php echo $type; ?>">
<a href="https://wordpress.stackexchange.com/questions/38098/edit.php?post_type=<?php echo $type; ?>"><?php echo $type; ?></a>
</td>
</tr>
<?php
endforeach;
}
Edit:
The code for the “Right Now” dashboard widget can be found in /wp-admin/includes/dashboard.php the function is wp_dashboard_right_now
. Unfortunately, there does not appear to be a filter that will allow you to remove post, page, categories, tags, or comments. If you want to remove them, you can use JavaScript to remove the elements from the DOM or you might be able to hide them with CSS (if there is a CSS parent selector?). Alternatively, you could copy the code and remove / add anything you want. If you don’t want to list all your custom post types, remove the get_post_types
and foreach loop, and replace $type
with the custom post type name.