twentyfifteen_get_link_url

Return the post URL.

Description

(string) twentyfifteen_get_link_url(); 

Falls back to the post permalink if no URL is found in the post.

Returns (string)

The Link format URL.


Usage

  1. if ( !function_exists( 'twentyfifteen_get_link_url' ) ) { 
  2. require_once '/inc/template-tags.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twentyfifteen_get_link_url(); 
  7.  

Defined (1)

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

/inc/template-tags.php  
  1. function twentyfifteen_get_link_url() { 
  2. $has_url = get_url_in_content( get_the_content() ); 
  3.  
  4. return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() );