comment_class хук-фильтр . WP 2.7.0
Filters the returned CSS classes for the current comment.
Использование
add_filter( 'comment_class', 'filter_function_name_5233', 10, 5 ); function filter_function_name_5233( $classes, $class, $comment_id, $comment, $post_id ){ // filter... return $classes; }
- $classes(строка[])
- An array of comment classes.
- $class(строка)
- A comma-separated list of additional classes added to the list.
- $comment_id(число)
- The comment ID.
- $comment(WP_Comment)
- The comment object.
- $post_id(число/WP_Post)
- The post ID or WP_Post object.
Список изменений
С версии 2.7.0 | Введена. |
Где вызывается хук
comment_class
wp-includes/comment-template.php 538
return apply_filters( 'comment_class', $classes, $class, $comment->comment_ID, $comment, $post_id );