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:

Description

Verifies an attachment is of a given type.

Related Functions

wp_attachment_is_image, wp_get_attachment_link, wp_count_attachments, the_attachment_links, wp_get_attachment_image

Top Google Results

User discussions

wpseek mobile