カスタム投稿タイプ表示数をダッシュボードに表示する管理画面カスタマイズです。例によって、テーマのfunctions.phpにコードを記述すればOkです。第二回WordBench神戸ではここまで進みませんでした。第三回WordBench神戸で紹介できたら、と思います。
※追記:カスタム分類版も作りました。
画像の例では、カスタム投稿タイプ「イベント(構築サイト紹介へ移動します)」を、ダッシュボードの現在の状況に表示しています。この投稿タイプを編集する権限がある場合は、クリックすると投稿タイプ一覧へ移動します。
コードの2行目、$custom_post_type = 'events';の部分には、(自分でつけた)カスタム投稿のラベル名を記述してください。
function custom_post_dashboard() {
$custom_post_type = 'events'; // カスタム投稿のラベル
global $wp_post_types;
$num_post_type = wp_count_posts( $custom_post_type );
$num = number_format_i18n($num_post_type->publish);
$text = _n( $wp_post_types[$custom_post_type]->labels->singular_name, $wp_post_types[$custom_post_type]->labels->name, $num_post_type->publish );
$capability = $wp_post_types[$custom_post_type]->cap->edit_posts;
if (current_user_can($capability)) {
$num = "<a href='edit.php?post_type=" . $custom_post_type . "'>$num</a>";
$text = "<a href='edit.php?post_type=" . $custom_post_type . "'>$text</a>";
}
echo '<tr>';
echo '<td class="first b b_' . $custom_post_type . '">' . $num . '</td>';
echo '<td class="t ' . $custom_post_type . '">' . $text . '</td>';
echo '</tr>';
}
add_action('right_now_content_table_end', 'custom_post_dashboard');
投稿数は、wp_count_postsで取得しています。right_now_content_table_endは、ダッシュボードの、「投稿、ページ」等の最後のところに用意されているアクションフックです。
wordpress本体のコーディングがテーブルタグを使用しているので、上記でもテーブルの一部としてHTML出力しています。

Standing on the Shoulder of Linus
第2回WordBench神戸は、カスタム投稿タイプとカスタム分類について、実際にコーディングしてみました。…
[…] カスタム投稿タイプの投稿数をダッシュボードに表示するの姉妹編です。今回の管理画面カスタマイズは、ログインしているユーザーが投稿した投稿数を表示します。 […]