# Pending Review Count in the Admin Menu

> Shows a red count bubble on Posts, Pages and custom post types when items are waiting for review, like WordPress does for comments.

- Type: PHP
- Runs: Admin only
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin, menu, workflow
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/pending-count-in-admin-menu/

## Code

```php
add_action( 'admin_menu', function () {
    global $menu;

    if ( ! current_user_can( 'edit_others_posts' ) || ! is_array( $menu ) ) {
        return;
    }

    foreach ( $menu as $index => $item ) {
        if ( empty( $item[2] ) ) {
            continue;
        }

        if ( 'edit.php' === $item[2] ) {
            $post_type = 'post';
        } elseif ( 0 === strpos( $item[2], 'edit.php?post_type=' ) ) {
            $post_type = substr( $item[2], strlen( 'edit.php?post_type=' ) );
        } else {
            continue;
        }

        if ( ! post_type_exists( $post_type ) ) {
            continue;
        }

        $pending = (int) wp_count_posts( $post_type )->pending;

        if ( $pending > 0 ) {
            $menu[ $index ][0] .= sprintf( ' <span class="awaiting-mod count-%1$d"><span class="pending-count">%1$d</span></span>', $pending );
        }
    }
}, 999 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Pending Review Count in the Admin Menu" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
