wp_attachment_is_image( int|WP_Post $post = null )
Checks if the attachment is an image.
Parameters
- $post
-
(Optional) Attachment ID or object. Default is global $post.
Default value: null
Return
(bool) Whether the attachment is an image.
Source
File: wp-includes/post.php
function wp_attachment_is_image( $post = null ) {
return wp_attachment_is( 'image', $post );
}
Changelog
Version | Description |
---|---|
WP-4.2.0 | Modified into wrapper for wp_attachment_is() and allowed WP_Post object to be passed. |
WP-2.1.0 | Introduced. |