get_post_format_string()
Returns a pretty, translated version of a post format slug
No Hooks.
Returns
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. |
get_post_format_string() get post format string code WP 7.0
function get_post_format_string( $slug ) {
$strings = get_post_format_strings();
if ( ! $slug ) {
return $strings['standard'];
} else {
return $strings[ $slug ] ?? '';
}
}