wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



weblog_ping › WordPress Function

Da1.2.0
Deprecaton/a
weblog_ping ( $server = '', $path = '' )
Parametri: (2)
  • (string) $server Host of blog to connect to.
    Richiesto: No
    Default: (vuoto)
  • (string) $path Path to send the ping.
    Richiesto: No
    Default: (vuoto)
Definito a:
Codex:

Sends a pingback.



Sorgenti

function weblog_ping( $server = '', $path = '' ) {
	require_once ABSPATH . WPINC . '/class-IXR.php';
	require_once ABSPATH . WPINC . '/class-wp-http-ixr-client.php';

	// Using a timeout of 3 seconds should be enough to cover slow servers.
	$client             = new WP_HTTP_IXR_Client( $server, ( ( ! strlen( trim( $path ) ) || ( '/' === $path ) ) ? false : $path ) );
	$client->timeout    = 3;
	$client->useragent .= ' -- WordPress/' . get_bloginfo( 'version' );

	// When set to true, this outputs debug messages by itself.
	$client->debug = false;
	$home          = trailingslashit( home_url() );
	if ( ! $client->query( 'weblogUpdates.extendedPing', get_option( 'blogname' ), $home, get_bloginfo( 'rss2_url' ) ) ) { // Then try a normal ping.
		$client->query( 'weblogUpdates.ping', get_option( 'blogname' ), $home );
	}
}