Skip to main content

add_action( 'admin_head', 'count_pending_review_posts', 99 );

add_action( 'admin_menu', function() { global $menu; $count = wp_count_posts( 'post' )->pending; if ( $count > 0 ) $menu[5][0] = 'Posts ' . $count. ''; });

add_action( 'admin_head', 'count_pending_review_posts', 99 );

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

    $count = wp_count_posts( 'post' )->pending;

    if ( $count > 0 ) {
        $menu[5][0] = 'Posts <span class="awaiting-mod">' . $count . '</span>';
    }
} );

You can try this.

add_action( 'admin_head', 'count_pending_review_posts', 99 );

add_action( 'admin_menu', function() { global $menu; $count = wp_count_posts( 'post' )->pending; if ( $count > 0 ) $menu[5][0] = 'Posts ' . $count. ''; });

You can try this.

add_action( 'admin_head', 'count_pending_review_posts', 99 );

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

    $count = wp_count_posts( 'post' )->pending;

    if ( $count > 0 ) {
        $menu[5][0] = 'Posts <span class="awaiting-mod">' . $count . '</span>';
    }
} );

You can try this.

Source Link

add_action( 'admin_head', 'count_pending_review_posts', 99 );

add_action( 'admin_menu', function() { global $menu; $count = wp_count_posts( 'post' )->pending; if ( $count > 0 ) $menu[5][0] = 'Posts ' . $count. ''; });

You can try this.