0

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!

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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