pre_comment_user_agent
Filters the comment author's browser user agent before it is set.
Использование
add_filter( 'pre_comment_user_agent', 'wp_kama_pre_comment_user_agent_filter' ); /** * Function for `pre_comment_user_agent` filter-hook. * * @param string $comment_agent The comment author's browser user agent. * * @return string */ function wp_kama_pre_comment_user_agent_filter( $comment_agent ){ // filter... return $comment_agent; }
- $comment_agent(строка)
- The comment author's browser user agent.
Список изменений
С версии 1.5.0 | Введена. |
Где вызывается хук
pre_comment_user_agent
wp-includes/comment.php 2133
$commentdata['comment_agent'] = apply_filters( 'pre_comment_user_agent', ( isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : '' ) );