get_post_format_link

Returns a link to a post format index.

Description

(string|WP_Error|false) get_post_format_link( (string) $format ); 

Returns (string|WP_Error|false)

The post format term link.

Parameters (1)

0. $format (string)
The post format slug.

Usage

  1. if ( !function_exists( 'get_post_format_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/post-formats.php'; 
  3.  
  4. // The post format slug. 
  5. $format = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_post_format_link($format); 
  9.  

Defined (1)

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

/wp-includes/post-formats.php  
  1. function get_post_format_link( $format ) { 
  2. $term = get_term_by('slug', 'post-format-' . $format, 'post_format' ); 
  3. if ( ! $term || is_wp_error( $term ) ) 
  4. return false; 
  5. return get_term_link( $term );