Add a red bubble with the number of posts waiting for review next to Posts in the admin menu.
add_action( 'admin_menu', function (): void {
global $menu;
if ( ! current_user_can( 'edit_others_posts' ) ) {
return;
}
$pending = (int) wp_count_posts( 'post' )->pending;
if ( ! $pending ) {
return;
}
foreach ( $menu as $i => $item ) {
if ( 'edit.php' === ( $item[2] ?? '' ) ) {
$menu[ $i ][0] .= sprintf( ' <span class="awaiting-mod count-%1$d"><span class="pending-count">%1$d</span></span>', $pending );
break;
}
}
}, 99 );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
When contributors submit posts for review, editors have to remember to check. WordPress shows bubbles for pending comments and updates, but not for posts. This snippet adds one.
wp_count_posts() returns post counts by status, cached by WordPress. If there are pending posts, the snippet finds the Posts item in the global $menu array and adds a counter using the same awaiting-mod markup as the Comments bubble, so it looks native.
Only users who can edit other people’s posts, editors and administrators, see it.
'post' and 'edit.php' to, for example, 'product' and 'edit.php?post_type=product'.Submit a post for review as a contributor, then log in as an editor. A “1” bubble should show next to Posts.