Filter hook 'akismet_optimize_table'

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

View Source

akismet_optimize_table

Filter Hook
Description
Determines how many days a comment will be left in the Spam queue before being deleted.

Hook Information

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

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into akismet_optimize_table
add_filter('akismet_optimize_table', 'my_custom_filter');

function my_custom_filter() {
    // Your custom filtering logic here
    return 'modified_value';
}

Source Code Context

wp-content/plugins/akismet/class.akismet.php:667 - How this hook is used in WordPress core
<?php
 662  			if ( microtime( true ) - $start_time > $max_exec_time ) {
 663  				return;
 664  			}
 665  		}
 666  
 667  		if ( apply_filters( 'akismet_optimize_table', ( mt_rand( 1, 5000 ) == 11 ), $wpdb->commentmeta ) ) { // lucky number
 668  			$wpdb->query( "OPTIMIZE TABLE {$wpdb->commentmeta}" );
 669  		}
 670  	}
 671  
 672  	// how many approved comments does this author have?

PHP Documentation

<?php
/**
		 * Determines how many days a comment will be left in the Spam queue before being deleted.
		 *
		 * @param int The default number of days.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 0
  • File: wp-content/plugins/akismet/class.akismet.php
Related Hooks

Related hooks will be displayed here in future updates.