pre_comment_content
Filters the comment content before it is set.
Использование
add_filter( 'pre_comment_content', 'wp_kama_pre_comment_content_filter' );
/**
* Function for `pre_comment_content` filter-hook.
*
* @param string $comment_content The comment content.
*
* @return string
*/
function wp_kama_pre_comment_content_filter( $comment_content ){
// filter...
return $comment_content;
}
- $comment_content(строка)
- The comment content.
Список изменений
| С версии 1.5.0 | Введена. |
Где вызывается хук
pre_comment_content
wp-includes/comment.php 2286
$commentdata['comment_content'] = apply_filters( 'pre_comment_content', $commentdata['comment_content'] );
Где используется хук в WordPress
wp-admin/includes/ajax-actions.php 1367
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-admin/includes/ajax-actions.php 1368
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/comment.php 2898
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/comment.php 2912
remove_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/comment.php 4095
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/comment.php 4096
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/default-filters.php 158
add_filter( $filter, 'convert_invalid_entities' );
wp-includes/default-filters.php 159
add_filter( $filter, 'balanceTags', 50 );
wp-includes/default-filters.php 312
add_filter( 'pre_comment_content', 'wp_rel_ugc', 15 );
wp-includes/default-filters.php 317
add_filter( 'pre_comment_content', '_wp_kses_sanitize_note_mention_classes', 11 );
wp-includes/kses.php 2552
add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/kses.php 2554
add_filter( 'pre_comment_content', 'wp_filter_kses' );
wp-includes/kses.php 2584
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
wp-includes/kses.php 2585
remove_filter( 'pre_comment_content', 'wp_filter_kses' );