Filter hook 'akismet_excluded_comment_types'

in WP Core File wp-content/plugins/akismet/class.akismet.php at line 689

View Source

akismet_excluded_comment_types

Filter Hook
Description
Which comment types should be ignored when counting a user's approved comments? Some plugins add entries to the comments table that are not actual comments that could have been checked by Akismet. Allow these comments to be excluded from the "approved comment count" query in order to avoid artificially inflating the approved comment count.

Hook Information

File Location wp-content/plugins/akismet/class.akismet.php View on GitHub
Hook Type Filter
Line Number 689

Hook Parameters

Type Name Description
array $comment_types An array of comment types that won't be considered when counting a user's approved comments.

Usage Examples

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

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

Source Code Context

wp-content/plugins/akismet/class.akismet.php:689 - How this hook is used in WordPress core
<?php
 684  		 * @param array $comment_types An array of comment types that won't be considered
 685  		 *                             when counting a user's approved comments.
 686  		 *
 687  		 * @since 4.2.2
 688  		 */
 689  		$excluded_comment_types = apply_filters( 'akismet_excluded_comment_types', array() );
 690  
 691  		$comment_type_where = '';
 692  
 693  		if ( is_array( $excluded_comment_types ) && ! empty( $excluded_comment_types ) ) {
 694  			$excluded_comment_types = array_unique( $excluded_comment_types );

PHP Documentation

<?php
/**
		 * Which comment types should be ignored when counting a user's approved comments?
		 *
		 * Some plugins add entries to the comments table that are not actual
		 * comments that could have been checked by Akismet. Allow these comments
		 * to be excluded from the "approved comment count" query in order to
		 * avoid artificially inflating the approved comment count.
		 *
		 * @param array $comment_types An array of comment types that won't be considered
		 *                             when counting a user's approved comments.
		 *
		 * @since 4.2.2
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-content/plugins/akismet/class.akismet.php
Related Hooks

Related hooks will be displayed here in future updates.