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

返回介绍

self_link()

发布于 2017-09-11 字数1411 浏览 938 评论 0

self_link()

Display the link for the currently displayed feed in a XSS safe way.


描述

Generate a correct link for the atom:self element.


源代码

File: wp-includes/feed.php

function self_link() {
	$host = @parse_url(home_url());
	/**
	 * Filters the current feed URL.
	 *
	 * @since 3.6.0
	 *
	 * @see set_url_scheme()
	 * @see wp_unslash()
	 *
	 * @param string $feed_link The link for the feed with set URL scheme.
	 */
	echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
}

更新日志

Version 描述
2.5.0 Introduced.

相关函数

Uses

  • wp-includes/formatting.php:
    wp_unslash()
  • wp-includes/formatting.php:
    esc_url()
  • wp-includes/link-template.php:
    set_url_scheme()
  • wp-includes/link-template.php:
    home_url()
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/feed.php:
    self_link
  • Show 1 more use
    Hide more uses


User Contributed Notes

发布评论

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

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