http_headers_useragent

过滤钩子


apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' )
参数
  • (string)
    $user_agent
    WordPress user agent string.
    Required:
  • (string)
    $url
    The request URL.
    Required:
定义位置
  • wp-includes/class-wp-http.php
    , line 192
引入
5.1.0
弃用

过滤随HTTP请求发送的用户代理值。

'user-agent'          => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), $url ),