Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
wp_attachment_is() - 验证附件是否为给定类型 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / wp_attachment_is()

wp_attachment_is( string $type, int|WP_Post $post = null ): bool

验证附件是否为给定类型


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 3 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "0df897c8dc4c1c33f0c7c3302f7c46b1" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "c36259426466be41cc8d1020291d7414" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

attachment 附件more...

is 条件判断more...


参数

$typestring必填
附件类型。接受'image'、'audio'或'video'。
$postint|WP_Post可选
附件ID或对象。默认值为全局$post。

默认:null


返回

bool 如果是接受的类型之一,则为true,否则为false。



源码

查看源码 官方文档


更新日志

版本描述
4.2.0开始引入

Warning: Undefined variable $o in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference.php on line 194