wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



trackback_url_list › WordPress Function

Seit1.0.0
Veraltetn/v
trackback_url_list ( $tb_list, $post_id )
Parameter: (2)
  • (string) $tb_list Comma separated list of URLs.
    Erforderlich: Ja
  • (int) $post_id Post ID.
    Erforderlich: Ja
Definiert in:
Codex:

Does trackbacks for a list of URLs.



Quellcode

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 );
		}
	}
}