admin_comment_types_dropdown
Filters the comment types shown in the drop-down menu on the Comments list table.
Usage
add_filter( 'admin_comment_types_dropdown', 'wp_kama_admin_comment_types_dropdown_filter' );
/**
* Function for `admin_comment_types_dropdown` filter-hook.
*
* @param string[] $comment_types Array of comment type labels keyed by their name.
*
* @return string[]
*/
function wp_kama_admin_comment_types_dropdown_filter( $comment_types ){
// filter...
return $comment_types;
}
- $comment_types(string[])
- Array of comment type labels keyed by their name.
Changelog
| Since 2.7.0 | Introduced. |
Where the hook is called
admin_comment_types_dropdown
wp-admin/includes/class-wp-comments-list-table.php 505-511
$comment_types = apply_filters( 'admin_comment_types_dropdown', array( 'comment' => __( 'Comments' ), 'pings' => __( 'Pings' ), ) );