pre_comment_user_agent

过滤钩子


apply_filters( 'pre_comment_user_agent', ( isset( $commentdata['comment_agent'] )
参数
  • (string)
    $comment_agent
    The comment author’s browser user agent.
    Required:
定义位置
  • wp-includes/comment.php
    , line 2112
引入
1.5.0
弃用

Filters the comment author’s browser user agent before it is set.

$commentdata['comment_agent'] = apply_filters( 'pre_comment_user_agent', ( isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : '' ) );