comment_save_pre хук-фильтрWP 1.5.0

Filters the comment content before it is updated in the database.

Использование

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(строка)
The comment data.

Список изменений

С версии 1.5.0 Введена.

Где вызывается хук

wp_update_comment()
comment_save_pre
wp-includes/comment.php 2537
$data['comment_content'] = apply_filters( 'comment_save_pre', $data['comment_content'] );

Где используется хук в WordPress

wp-includes/default-filters.php 146
add_filter( $filter, 'convert_invalid_entities' );
wp-includes/default-filters.php 147
add_filter( $filter, 'balanceTags', 50 );