WordPress at a glance
filter is not described

http_headers_useragent filter-hook . WP 2.7.0

Filters the user agent value sent with an HTTP request.

Usage

add_filter( 'http_headers_useragent', 'filter_function_name_7531', 10, 2 );
function filter_function_name_7531( $user_agent, $url ){
	// filter...

	return $user_agent;
}
$user_agent(string)
WordPress user agent string.
$url(string)
The request URL.

Notes

  • Since 5.1.0 The $url parameter was added.

Where the hook is called

WP_Http::request()
http_headers_useragent
wp_xmlrpc_server::pingback_ping()
http_headers_useragent
wp-includes/class-http.php 191
'user-agent'          => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), $url ),
wp-includes/class-wp-xmlrpc-server.php 6757
$user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), $url );

Where the hook is used (in WP core)

Does not used.