wp_attachment_is_image( int|WP_Post $post = null ): bool

Determines whether an attachment is an image.

Description

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.

Parameters

$postint|WP_Postoptional
Attachment ID or object. Default is global $post.

Default:null

Return

bool Whether the attachment is an image.