对URL列表进行引用。
原型
trackback_url_list( string $tb_list, int $post_id )
参数
$tb_list
(string)
(Required)
以逗号分隔的URL列表。
$post_id
(int)
(Required)
帖子ID。
源文件
路径:wp-includes/post.php
<?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 );
}
}
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/trackback_url_list/