get_to_ping

Retrieve URLs that need to be pinged.

Description

(array) get_to_ping( (int|WP_Post) $post_id ); 

Returns (array)

Parameters (1)

0. $post_id (int|WP_Post)
Post Object or ID

Usage

  1. if ( !function_exists( 'get_to_ping' ) ) { 
  2. require_once ABSPATH . WPINC . '/post.php'; 
  3.  
  4. // Post Object or ID 
  5. $post_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_to_ping($post_id); 
  9.  

Defined (1)

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

/wp-includes/post.php  
  1. function get_to_ping( $post_id ) { 
  2. $post = get_post( $post_id ); 
  3.  
  4. if ( ! $post ) { 
  5. return false; 
  6.  
  7. $to_ping = sanitize_trackback_urls( $post->to_ping ); 
  8. $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY); 
  9.  
  10. /** 
  11. * Filters the list of URLs yet to ping for the given post. 
  12. * @since 2.0.0 
  13. * @param array $to_ping List of URLs yet to ping. 
  14. */ 
  15. return apply_filters( 'get_to_ping', $to_ping );