trackback_url_list() WordPress Function

The trackback_url_list() function in WordPress allows you to retrieve a list of URLs for trackbacks for a given post. This can be useful for debugging or for display purposes.

trackback_url_list( string $tb_list, int $post_id ) #

Do trackbacks for a list of URLs.


Parameters

$tb_list

(string)(Required)Comma separated list of URLs.

$post_id

(int)(Required)Post ID.


Top ↑

Source

File: wp-includes/post.php

function trackback_url_list( $tb_list, $post_id ) {
	if ( ! empty( $tb_list ) ) {
		// Get post data.
		$postdata = get_post( $post_id, ARRAY_A );

		// Form an excerpt.
		$excerpt = strip_tags( $postdata['post_excerpt'] ? $postdata['post_excerpt'] : $postdata['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, wp_unslash( $postdata['post_title'] ), $excerpt, $post_id );
		}
	}
}


Top ↑

Changelog

Changelog
VersionDescription
1.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More