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:

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