get_self_link() WordPress Function
The get_self_link() function in WordPress allows you to get the URL of the current page. This is useful for creating links back to the current page, or for creating links to other pages on your site.
get_self_link() #
Returns the link for the currently displayed feed.
Return
(string) Correct link for the atom:self element.
Source
File: wp-includes/feed.php
function get_self_link() { $host = parse_url( home_url() ); return set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.3.0 | Introduced. |