A WordPress-centric search engine for devs and theme authors



wp_attachment_is_image ›

Since2.1.0
Deprecatedn/a
wp_attachment_is_image ( $post = null )
Parameters:
  • (int|WP_Post) $post Optional. Attachment ID or object. Default is global $post.
    Required: No
    Default: null
Returns:
  • (bool) Whether the attachment is an image.
Defined at:
Codex:
Change Log:
  • 4.2.0

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.



Source

function wp_attachment_is_image( $post = null ) {
	return wp_attachment_is( 'image', $post );
}