WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This one might be a little tricky, but I'm looking for a way to make the Recent Comments widget on the wp-admin a bit more useful/action-driven. I'd like to be able to filter to only show the Pending comments (as those would require an action to them). I saw on line 45 of wp-admin/includes/dashboard.php there is:

// Recent Comments Widget
    if ( is_blog_admin() && current_user_can('moderate_comments') ) {
        if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) {
            $update = true;
            $widget_options['dashboard_recent_comments'] = array(
                'items' => 5,
        $recent_comments_title = __( 'Recent Comments' );
        wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' );

but I'm a little fuzzy on the correct way (or if there is a way) to hook into this to modify the "types" of comments shown. Any help would be greatly appreciated. Thanks!

share|improve this question
up vote 0 down vote accepted

There doesn't seem to be a hook/filter available to control comments displayed in the widget. You might have to create new dashboard widget for this as new plugin or as part of themes function.php

share|improve this answer
Thanks - appreciate the response! – Zach Dec 30 '11 at 1:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.