Advertisements

trackback_url_list

Definition:
function trackback_url_list($tb_list, $post_id) {}

Do trackbacks for a list of URLs.

Parameters

  • string $tb_list: Comma separated list of URLs
  • int $post_id: Post ID

Source code

function trackback_url_list($tb_list, $post_id) {

	if ( ! empty( $tb_list ) ) {

		// get post data

		$postdata = wp_get_single_post($post_id, ARRAY_A);



		// import postdata as variables

		extract($postdata, EXTR_SKIP);



		// form an excerpt

		$excerpt = strip_tags($post_excerpt ? $post_excerpt : $post_content);



		if (strlen($excerpt) > 255) {

			$excerpt = substr($excerpt,0,252) . '...';

		}



		$trackback_urls = explode(',', $tb_list);

		foreach( (array) $trackback_urls as $tb_url) {

			$tb_url = trim($tb_url);

			trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);

		}

	}

}

3077

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: