trackback_url_list

Do trackbacks for a list of URLs.

Description

trackback_url_list( (string) $tb_list, (int) $post_id ); 

Parameters (2)

0. $tb_list (string)
Comma separated list of URLs.
1. $post_id (int)
The post id.

Usage

  1. if ( !function_exists( 'trackback_url_list' ) ) { 
  2. require_once ABSPATH . WPINC . '/post.php'; 
  3.  
  4. // Comma separated list of URLs. 
  5. $tb_list = ''; 
  6.  
  7. // The post id. 
  8. $post_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = trackback_url_list($tb_list, $post_id); 
  12.  

Defined (1)

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

/wp-includes/post.php  
  1. function trackback_url_list( $tb_list, $post_id ) { 
  2. if ( ! empty( $tb_list ) ) { 
  3. // Get post data. 
  4. $postdata = get_post( $post_id, ARRAY_A ); 
  5.  
  6. // Form an excerpt. 
  7. $excerpt = strip_tags( $postdata['post_excerpt'] ? $postdata['post_excerpt'] : $postdata['post_content'] ); 
  8.  
  9. if ( strlen( $excerpt ) > 255 ) { 
  10. $excerpt = substr( $excerpt, 0, 252 ) . '…'; 
  11.  
  12. $trackback_urls = explode( ', ', $tb_list ); 
  13. foreach ( (array) $trackback_urls as $tb_url ) { 
  14. $tb_url = trim( $tb_url ); 
  15. trackback( $tb_url, wp_unslash( $postdata['post_title'] ), $excerpt, $post_id );