函数原型
get_trackback_url(): string
函数描述
Retrieves the current post’s trackback URL.
是否弃用
未弃用
函数参数
无
函数返回值
string The trackback URL after being filtered.
函数位置
File: wp-includes/comment-template.php.
函数源码
function get_trackback_url() {
if ( get_option( 'permalink_structure' ) ) {
$trackback_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );
} else {
$trackback_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();
}
/**
* Filters the returned trackback URL.
*
* @since 2.2.0
*
* @param string $trackback_url The trackback URL.
*/
return apply_filters( 'trackback_url', $trackback_url );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |

