WordPress at a glance
function is not described

trackback() WP 0.71

Send a Trackback.

Updates database when sending trackback to prevent duplicates.

  • Global. wpdb. $wpdb WordPress database abstraction object.

No Hooks.

Return

Int/false/null. Database query from update.

Usage

trackback( $trackback_url, $title, $excerpt, $ID );
$trackback_url(string) (required)
URL to send trackbacks.
$title(string) (required)
Title of post.
$excerpt(string) (required)
Excerpt of post.
$ID(int) (required)
Post ID.

Code of trackback: wp-includes/comment.php VER 5.1.1

<?php
function trackback( $trackback_url, $title, $excerpt, $ID ) {
	global $wpdb;

	if ( empty( $trackback_url ) ) {
		return;
	}

	$options            = array();
	$options['timeout'] = 10;
	$options['body']    = array(
		'title'     => $title,
		'url'       => get_permalink( $ID ),
		'blog_name' => get_option( 'blogname' ),
		'excerpt'   => $excerpt,
	);

	$response = wp_safe_remote_post( $trackback_url, $options );

	if ( is_wp_error( $response ) ) {
		return;
	}

	$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $ID ) );
	return $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $ID ) );
}