get_post_format_string

Returns a pretty, translated version of a post format slug.

Description

(string) get_post_format_string( (string) $slug ); 

Returns (string)

The translated post format name.

Parameters (1)

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

Usage

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

Defined (1)

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

/wp-includes/post-formats.php  
  1. function get_post_format_string( $slug ) { 
  2. $strings = get_post_format_strings(); 
  3. if ( !$slug ) 
  4. return $strings['standard']; 
  5. else 
  6. return ( isset( $strings[$slug] ) ) ? $strings[$slug] : '';