pre_comment_content filter-hookWP 1.5.0

Filters the comment content before it is set.

Usage

add_filter( 'pre_comment_content', 'wp_kama_pre_comment_content_filter' );
function wp_kama_pre_comment_content_filter( $comment_content ){
	// filter...

	return $comment_content;
}
$comment_content(string)
The comment content.

Changelog

Since 1.5.0 Introduced.

Where the hook is called

wp_filter_comment()
pre_comment_content
wp-includes/comment.php 2124
$commentdata['comment_content'] = apply_filters( 'pre_comment_content', $commentdata['comment_content'] );

Where the hook is used in WordPress

wp-admin/includes/ajax-actions.php 1305
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-admin/includes/ajax-actions.php 1306
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/comment.php 3538
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/comment.php 3539
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/default-filters.php 126
add_filter( $filter, 'convert_invalid_entities' );
wp-includes/default-filters.php 127
add_filter( $filter, 'balanceTags', 50 );
wp-includes/default-filters.php 280
add_filter( 'pre_comment_content', 'wp_rel_ugc', 15 );
wp-includes/kses.php 2199
add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/kses.php 2201
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/kses.php 2231
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/kses.php 2232
remove_filter( 'pre_comment_content', 'wp_filter_kses' );