wp_attachment_is
wp_attachment_is ( $type, $post = null )
Parameters:- (string) type Attachment type. Accepts `image`, `audio`, `video`, or a file extension.
- (int|WP_Post) post Optional. Attachment ID or object. Default is global $post.
Returns:- (bool) True if an accepted type or a matching file extension, false otherwise.
Defined at: - Introduced in WordPress: 4.2.0
- Deprecated in WordPress: —
Description
Verifies an attachment is of a given type.