首页 WordPress函数大全 has_post_format()

has_post_format()

2020-05-02 / 2144阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

has_post_format( string|array $format = array(), WP_Post|int|null $post = null )

Check if a post has any of the given formats, or any format.

描述

参数

$format

(string|array)
(Optional)
The format or formats to check.

Default value: array()

$post

(WP_Post|int|null)
(Optional)
The post to check. If not supplied, defaults to the current post if used in the loop.

Default value: null

返回

(bool) True if the post has any of the given formats (or any format, if no format specified), false otherwise.

大家谈论
    我的见解