get_post_format_string() WP 3.1.0
Returns a pretty, translated version of a post format slug
No Hooks.
Return
String. The translated post format name.
Usage
get_post_format_string( $slug );
- $slug(string) (required)
- A post format slug.
Changelog
Since 3.1.0 | Introduced. |
Code of get_post_format_string() get post format string WP 5.6
function get_post_format_string( $slug ) {
$strings = get_post_format_strings();
if ( ! $slug ) {
return $strings['standard'];
} else {
return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : '';
}
}