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, the_attachment_links, wp_count_attachments, wp_get_attachment_image

Top Google Results

User discussions

wpseek mobile