self_link

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

Description

self_link(); 

Generate a correct link for the atom:self element.


Usage

  1. if ( !function_exists( 'self_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/feed.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = self_link(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/feed.php  
  1. function self_link() { 
  2. $host = @parse_url(home_url()); 
  3. /** 
  4. * Filters the current feed URL. 
  5. * @since 3.6.0 
  6. * @see set_url_scheme() 
  7. * @see wp_unslash() 
  8. * @param string $feed_link The link for the feed with set URL scheme. 
  9. */ 
  10. echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );