Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pingback_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
1853
1854           if ( $pingback_server_url ) {
1855                @ set_time_limit( 60 );
1856                 // Now, the RPC call
1857                $pagelinkedfrom = get_permalink($post_ID);
1858
1859                // using a timeout of 3 seconds should be enough to cover slow servers
1860                $client = new WP_HTTP_IXR_Client($pingback_server_url);
1861                $client->timeout = 3;
1862                $client->useragent = apply_filters( 'pingback_useragent', $client->useragent . ' -- WordPress/' . $wp_version, $client->useragent, $pingback_server_url, $pagelinkedto, $pagelinkedfrom);
1863                // when set to true, this outputs debug messages by itself
1864                $client->debug = false;
1865
1866                if ( $client->query('pingback.ping', $pagelinkedfrom, $pagelinkedto) || ( isset($client->error->code) && 48 == $client->error->code ) ) // Already registered
1867                     add_ping( $post_ID, $pagelinkedto );
1868           }
1869      }
1870 }
1871