Advertisements

weblog_ping

Definition:
function weblog_ping($server = '', $path = '') {}

Send a pingback.

Parameters

  • string $server: Host of blog to connect to.
  • string $path: Path to send the ping.

Source code

function weblog_ping($server = '', $path = '') {

	global $wp_version;

	include_once(ABSPATH . WPINC . '/class-IXR.php');

	include_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/'.$wp_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);

}

3351

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: