generic_ping

Sends pings to all of the ping site services.

Description

(int) generic_ping( (int) $post_id = 0 ); 

Returns (int)

Same as Post ID from parameter

Parameters (1)

0. $post_id — Optional. (int)
The post id.

Usage

  1. if ( !function_exists( 'generic_ping' ) ) { 
  2. require_once ABSPATH . WPINC . '/comment.php'; 
  3.  
  4. // The post id. 
  5. $post_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = generic_ping($post_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/comment.php  
  1. function generic_ping( $post_id = 0 ) { 
  2. $services = get_option('ping_sites'); 
  3.  
  4. $services = explode("\n", $services); 
  5. foreach ( (array) $services as $service ) { 
  6. $service = trim($service); 
  7. if ( '' != $service ) 
  8. weblog_ping($service); 
  9.  
  10. return $post_id;