get_trackback_url() - WordPress 函数参考中文文档

返回介绍

get_trackback_url()

发布于 2017-09-11 字数1996 浏览 948 评论 0

get_trackback_url()

Retrieve The current post’s trackback URL.


描述

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.


返回值

(string) The trackback URL after being filtered.


源代码

File: wp-includes/comment-template.php

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.
	 *
	 * @since 2.2.0
	 *
	 * @param string $tb_url The trackback URL.
	 */
	return apply_filters( 'trackback_url', $tb_url );
}

更新日志

Version 描述
1.5.0 Introduced.

相关函数

Uses

  • wp-includes/formatting.php:
    trailingslashit()
  • wp-includes/link-template.php:
    get_permalink()
  • wp-includes/link-template.php:
    user_trailingslashit()
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/option.php:
    get_option()
  • wp-includes/post-template.php:
    get_the_ID()
  • wp-includes/comment-template.php:
    trackback_url
  • Show 2 more uses
    Hide more uses


Used By

  • wp-includes/comment-template.php:
    trackback_url()
  • wp-includes/comment-template.php:
    trackback_rdf()

User Contributed Notes

上一篇:get_to_ping()

下一篇:get_transient()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!