#39: admin_comment_types_dropdown

The admin_comment_types_dropdown filter allows you to modify the options supplied to the comment types drop down in the Comments screen. The built-in values are Comments and Pings.

It is evaluated in WP_Comments_List_Table::extra_tablenav() in the wp-admin/includes/class-wp-comments-list-table.php file.

admin_comment_types_dropdown accepts a single argument:

  1. array $comment_types An array of comment types to be used as options in the drop down.

Example:

There is no (useful) example for this filter yet. Have an idea for one? Submit an example.

#38: comment_status_links

The comment_status_links filter allows you to modify the status links used to filter the comments list table. The default comment statuses are All, Pending, Approved, Spam, and Trash.

It is evaluated in WP_Comments_List_Table::get_views() in the wp-admin/includes/class-wp-comments-list-table.php file.

comment_status_links accepts a single argument:

  1. array $status_links An array of fully-formed status links.

Example:

The following shows how you might hide one of the default comment status links, such as say, the Pending view.

View the code example on Gist.

#37: comments_per_page

The comments_per_page filter allows you to define the number of comments to list per page in the comments list table.

It is evaluated in:

comments_per_page accepts 2 arguments:

  1. int $comments_per_page The number of comments to list per page.
  2. string $comment_status The comment status name. Default is ‘all’.

Example:

I don’t know about you, but when I go to clean out spam comments, it’s irritating to have that extra step of upping the comments per page — the default is 20 — just so I can bulk-delete them faster. The following example raises the comments-per-page amount only when you’re in the ‘Spam’ filtered view.

View the code example on Gist.