# Pending Review Dashboard Widget

> Shows everything waiting for review on the dashboard, with the author and a direct link to review it.

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

## Code

```php
add_action( 'wp_dashboard_setup', function () {
    if ( ! current_user_can( 'edit_others_posts' ) ) {
        return;
    }

    wp_add_dashboard_widget( 'wpide_pending_review', 'Waiting for Review', function () {
        $pending = get_posts( array(
            'post_type'   => 'any',
            'post_status' => 'pending',
            'numberposts' => 20,
            'orderby'     => 'date',
            'order'       => 'ASC',
        ) );

        if ( ! $pending ) {
            echo '<p>Nothing is waiting for review.</p>';
            return;
        }

        echo '<table class="widefat striped"><tbody>';
        foreach ( $pending as $item ) {
            $type = get_post_type_object( $item->post_type );
            printf(
                '<tr><td><a href="%1$s"><strong>%2$s</strong></a><br><small>%3$s by %4$s</small></td><td style="text-align:right">%5$s</td></tr>',
                esc_url( get_edit_post_link( $item->ID ) ),
                esc_html( get_the_title( $item ) ? get_the_title( $item ) : '(no title)' ),
                esc_html( $type ? $type->labels->singular_name : $item->post_type ),
                esc_html( get_the_author_meta( 'display_name', $item->post_author ) ),
                esc_html( get_the_date( '', $item ) )
            );
        }
        echo '</tbody></table>';
    } );
} );
```

## Notes

Oldest submissions are listed first.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Pending Review Dashboard Widget" 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/
