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 2663
$data['comment_content'] = apply_filters( 'comment_save_pre', $data['comment_content'] );
Where the hook is used in WordPress
wp-includes/default-filters.php 158
add_filter( $filter, 'convert_invalid_entities' );
wp-includes/default-filters.php 159
add_filter( $filter, 'balanceTags', 50 );