wp_attachment_is_image


wp_attachment_is_image ( $post = null )

Parameters:
  • (int|WP_Post) $post Optional. Attachment ID or object. Default is global $post.
Returns:
  • (bool) Whether the attachment is an image.
Defined at:
Change Log:
  • 4: .

Description

Determines whether an attachment is an image.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.

Related Functions

wp_get_attachment_image, wp_attachment_is, wp_get_attachment_image_url, wp_get_attachment_image_src, wp_get_attachment_image_sizes

Top Google Results

User discussions

wpseek mobile