// Escape values to use in the trackback.
$title =
wp_slash( $title );
$excerpt =
wp_slash( $excerpt );
$blog_name =
wp_slash( $blog_name );
if ( is_single() ||
is_page() ) { $post_id =
$posts[0
]->ID;
}if ( !
isset( $post_id ) || !
(int) $post_id ) { trackback_response( 1,
__( 'I really need an ID for this to work.'
) );
}if ( empty( $title ) &&
empty( $trackback_url ) &&
empty( $blog_name ) ) { // If it doesn't look like a trackback at all.
wp_redirect( get_permalink( $post_id ) );
exit;
}if ( !
empty( $trackback_url ) && !
empty( $title ) ) { /**
* Fires before the trackback is added to a post.
*
* @since 4.7.0
*
* @param int $post_id Post ID related to the trackback.
* @param string $trackback_url Trackback URL.
* @param string $charset Character set.
* @param string $title Trackback title.
* @param string $excerpt Trackback excerpt.
* @param string $blog_name Site name.
*/