wp_attachment_is_image() – Determines whether an attachment is an image.

You appear to be a bot. Output may be restricted

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.

Usage

$bool = wp_attachment_is_image( $post );

Parameters

$post
( int|WP_Post ) optional – Optional. Attachment ID or object. Default is global $post.

Returns

bool Whether the attachment is an image.

Source

File name: wordpress/wp-includes/post.php
Lines:

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

 View on GitHub View on Trac