comment_save_pre
Filters the comment content before it is updated in the database.
Usage
add_filter( 'comment_save_pre', 'wp_kama_comment_save_pre_filter' ); /** * Function for `comment_save_pre` filter-hook. * * @param string $comment_content The comment data. * * @return string */ function wp_kama_comment_save_pre_filter( $comment_content ){ // filter... return $comment_content; }
- $comment_content(string)
- The comment data.
Changelog
Since 1.5.0 | Introduced. |
Where the hook is called
wp-includes/comment.php 2537
$data['comment_content'] = apply_filters( 'comment_save_pre', $data['comment_content'] );
Where the hook is used in WordPress
wp-includes/default-filters.php 146
add_filter( $filter, 'convert_invalid_entities' );
wp-includes/default-filters.php 147
add_filter( $filter, 'balanceTags', 50 );