函数原型
get_post_format( int|WP_Post|null $post = null ): string|false
函数描述
Retrieve the format slug for a post
是否弃用
未弃用
函数参数
-
$post
int|WP_Post|null
Optional - Post ID or post object. Defaults to the current post in the loop.
Default:
null
函数返回值
string|false The format if successful. False otherwise.
函数位置
File: wp-includes/post-formats.php.
函数源码
$format = get_post_format() ? : 'standard';源码链接
变更日志
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |

