self_link() WordPress Function

The self_link() function is used to generate a self-referencing link to the current page. This is useful for creating links to pages that change frequently, such as a blog post archive or a search results page.

self_link() #

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


Description

Generate a correct link for the atom:self element.


Top ↑

Source

File: wp-includes/feed.php

function self_link() {
	/**
	 * 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', get_self_link() ) );
}


Top ↑

Changelog

Changelog
VersionDescription
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.