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