函数原型
get_post_format_string( string $slug ): string
函数描述
Returns a pretty, translated version of a post format slug
是否弃用
未弃用
函数参数
-
$slug
string
Required - A post format slug.
函数返回值
string The translated post format name.
函数位置
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 ] : '';
}
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |

