wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_attachment_is_image › WordPress Function

Since2.1.0
已弃用n/a
wp_attachment_is_image ( $post = null )
参数:
  • (int|WP_Post) $post Optional. Attachment ID or object. Default is global $post.
    Required: No
    默认: null
返回:
  • (bool) Whether the attachment is an image.
定义在:
文档:
Change Log:
  • 4.2.0

Determines whether an attachment is an image.

For more information on this and similar theme functions, check out the {@link Conditional Tags} article in the Theme Developer Handbook.


源码

function wp_attachment_is_image( $post = null ) {
	return wp_attachment_is( 'image', $post );
}