Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: http_headers_useragent

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
6853                return $this->pingback_error( 48, __( 'The pingback has already been registered.' ) );
6854           }
6855
6856           // Very stupid, but gives time to the 'from' server to publish!
6857           sleep( 1 );
6858
6859           $remote_ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
6860
6861           /** This filter is documented in wp-includes/class-http.php */
6862           $user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), $pagelinkedfrom );
6863
6864           // Let's check the remote site.
6865           $http_api_args = array(
6866                'timeout'             => 10,
6867                'redirection'         => 0,
6868                'limit_response_size' => 153600, // 150 KB
6869                'user-agent'          => "$user_agent; verifying pingback from $remote_ip",
6870                'headers'             => array(
6871                     'X-Pingback-Forwarded-For' => $remote_ip,