Filter hook 'admin_comment_types_dropdown'

in WP Core File wp-admin/includes/class-wp-comments-list-table.php at line 505

View Source

admin_comment_types_dropdown

Filter Hook
Description
Filters the comment types shown in the drop-down menu on the Comments list table.

Hook Information

File Location wp-admin/includes/class-wp-comments-list-table.php View on GitHub
Hook Type Filter
Line Number 505

Hook Parameters

Type Name Description
string[] $comment_types Array of comment type labels keyed by their name.

Usage Examples

Basic Usage
<?php
// Hook into admin_comment_types_dropdown
add_filter('admin_comment_types_dropdown', 'my_custom_filter', 10, 1);

function my_custom_filter($comment_types) {
    // Your custom filtering logic here
    return $comment_types;
}

Source Code Context

wp-admin/includes/class-wp-comments-list-table.php:505 - How this hook is used in WordPress core
<?php
 500  		 *
 501  		 * @since 2.7.0
 502  		 *
 503  		 * @param string[] $comment_types Array of comment type labels keyed by their name.
 504  		 */
 505  		$comment_types = apply_filters(
 506  			'admin_comment_types_dropdown',
 507  			array(
 508  				'comment' => __( 'Comments' ),
 509  				'pings'   => __( 'Pings' ),
 510  			)

PHP Documentation

<?php
/**
		 * Filters the comment types shown in the drop-down menu on the Comments list table.
		 *
		 * @since 2.7.0
		 *
		 * @param string[] $comment_types Array of comment type labels keyed by their name.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/class-wp-comments-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.