WordPress at a glance

wp_attachment_is_image() WP 1.0

Checks if the attachment is an image.

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

  • Since 4.2.0 Modified into wrapper for wp_attachment_is() and allowed WP_Post object to be passed.
Works based on: wp_attachment_is()
✈ 1 time = 0.000291s = fast | 50000 times = 0.44s = very fast | PHP 7.0.14, WP 4.7

No Hooks.


true/false. Whether the attachment is an image.


wp_attachment_is_image( $post );
Attachment ID or object.
Default: global $post

Code of wp attachment is image: wp-includes/post.php VER 5.1.1

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

Related Functions

From tag: Conditional tags (all)

More from category: Images

No comments
    Hello, !     Log In . Register