do_all_pings

Perform all pingbacks, enclosures, trackbacks, and send to pingback services.

Description

do_all_pings(); 

Usage

  1. if ( !function_exists( 'do_all_pings' ) ) { 
  2. require_once ABSPATH . WPINC . '/comment.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = do_all_pings(); 
  7.  

Defined (1)

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

/wp-includes/comment.php  
  1. function do_all_pings() { 
  2. global $wpdb; 
  3.  
  4. // Do pingbacks 
  5. while ($ping = $wpdb->get_row("SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) { 
  6. delete_metadata_by_mid( 'post', $ping->meta_id ); 
  7. pingback( $ping->post_content, $ping->ID ); 
  8.  
  9. // Do Enclosures 
  10. while ($enclosure = $wpdb->get_row("SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) { 
  11. delete_metadata_by_mid( 'post', $enclosure->meta_id ); 
  12. do_enclose( $enclosure->post_content, $enclosure->ID ); 
  13.  
  14. // Do Trackbacks 
  15. $trackbacks = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE to_ping <> '' AND post_status = 'publish'"); 
  16. if ( is_array($trackbacks) ) 
  17. foreach ( $trackbacks as $trackback ) 
  18. do_trackbacks($trackback); 
  19.  
  20. //Do Update Services/Generic Pings