Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




weblog_ping [ WordPress Function ]

weblog_ping ( $server = '', $path = '' )
Parameters:
  • (string) $server Host of blog to connect to.
  • (string) $path Path to send the ping.
Uses:
  • $wp_version
  • IXR_Client
Defined at:



Send a pingback.

Source


<?php
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 trailingslashithome_url() );
    if ( !
$client->query('weblogUpdates.extendedPing'get_option('blogname'), $homeget_bloginfo('rss2_url') ) ) // then try a normal ping
        
$client->query('weblogUpdates.ping'get_option('blogname'), $home);
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics