On this page
trackback_url_list( string $tb_list, int $post_id )
Does trackbacks for a list of URLs.
Parameters
$tb_liststring Required-
Comma separated list of URLs.
$post_idint Required-
Post ID.
Source
File: wp-includes/post.php. View all references
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 );
}
}
}
Related
Uses
| Uses | Description |
|---|---|
| trackback() wp-includes/comment.php | Sends a Trackback. |
| wp_unslash() wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| get_post() wp-includes/post.php | Retrieves post data given a post ID or post object. |
Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/trackback_url_list