comment_author
Filters the comment author's name for display.
Использование
add_filter( 'comment_author', 'wp_kama_comment_author_filter', 10, 2 ); /** * Function for `comment_author` filter-hook. * * @param string $comment_author The comment author's username. * @param string $comment_id The comment ID as a numeric string. * * @return string */ function wp_kama_comment_author_filter( $comment_author, $comment_id ){ // filter... return $comment_author; }
- $comment_author(строка)
- The comment author's username.
- $comment_id(строка)
- The comment ID as a numeric string.
Список изменений
С версии 1.2.0 | Введена. |
С версии 4.1.0 | The $comment_id parameter was added. |
Где вызывается хук
comment_author
wp-includes/comment-template.php 76
echo apply_filters( 'comment_author', $comment_author, $comment->comment_ID );
Где используется хук в WordPress
wp-admin/includes/class-wp-comments-list-table.php 44
add_filter( 'comment_author', array( $this, 'floated_admin_avatar' ), 10, 2 );
wp-includes/default-filters.php 155
add_filter( $filter, 'wptexturize' );
wp-includes/default-filters.php 156
add_filter( $filter, 'convert_chars' );
wp-includes/default-filters.php 157
add_filter( $filter, 'esc_html' );