preprocess_comment filter-hookWP 1.5.0

Filters a comment's data before it is sanitized and inserted into the database.

Usage

add_filter( 'preprocess_comment', 'wp_kama_preprocess_comment_filter' );

/**
 * Function for `preprocess_comment` filter-hook.
 * 
 * @param array $commentdata Comment data.
 *
 * @return array
 */
function wp_kama_preprocess_comment_filter( $commentdata ){

	// filter...
	return $commentdata;
}
$commentdata(array)
Comment data.

Changelog

Since 1.5.0 Introduced.
Since 5.6.0 Comment data includes the comment_agent and comment_author_IP values.

Where the hook is called

wp_new_comment()
preprocess_comment
wp-includes/comment.php 2243
$commentdata = apply_filters( 'preprocess_comment', $commentdata );

Where the hook is used in WordPress

Usage not found.