get_post_format_string() WordPress Function
The get_post_format_string function allows you to get the string for a particular post format. This is useful for displaying the post format name in your theme.
get_post_format_string( string $slug ) #
Returns a pretty, translated version of a post format slug
Parameters
- $slug
(string)(Required)A post format slug.
Return
(string) The translated post format name.
Source
File: wp-includes/post-formats.php
function get_post_format_string( $slug ) { $strings = get_post_format_strings(); if ( ! $slug ) { return $strings['standard']; } else { return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : ''; } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |