trackback_url_list

The timeline below displays how wordpress function trackback_url_list has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Does trackbacks for a list of URLs.
 *
 * @since 1.0.0
 *
 * @param string $tb_list Comma separated list of URLs.
 * @param int    $post_id Post ID.
 */
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);
        }
    }
}

WordPress Version: 4.0

/**
 * Do trackbacks for a list of URLs.
 *
 * @since 1.0.0
 *
 * @param string $tb_list Comma separated list of URLs.
 * @param int    $post_id Post ID.
 */
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);
        }
    }
}

WordPress Version: 3.7

/**
 * Do trackbacks for a list of URLs.
 *
 * @since 1.0.0
 *
 * @param string $tb_list Comma separated list of URLs
 * @param int $post_id Post ID
 */
function trackback_url_list($tb_list, $post_id)
{
    if (!empty($tb_list)) {
        // get post data
        $postdata = get_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, wp_unslash($post_title), $excerpt, $post_id);
        }
    }
}