get_trackback_url

Advertisement

Summery Summery

Retrieves the current post’s trackback URL.

Syntax Syntax

get_trackback_url()

Description Description

There is a check to see if permalink’s have been enabled and if so, will retrieve the pretty path. If permalinks weren’t enabled, the ID of the current post is used and appended to the correct page to go to.

Return Return

(string) The trackback URL after being filtered.

Source Source

File: wp-includes/comment-template.php

 * current post is used and appended to the correct page to go to.
 *
 * @since 1.5.0
 *
 * @return string The trackback URL after being filtered.
 */
function get_trackback_url() {
	if ( get_option( 'permalink_structure' ) ) {
		$tb_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );
	} else {
		$tb_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();
	}

	/**
	 * Filters the returned trackback URL.
	 *

Advertisement

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.