Determines whether an attachment is an image.
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
$postint|WP_Postoptional
Default:null
function wp_attachment_is_image( $post = null ) {
return wp_attachment_is( 'image', $post );
}
| Version | Description |
|---|---|
| 4.2.0 | Modified into wrapper for wp_attachment_is() and allowed WP_Post object to be passed. |
| 2.1.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_attachment_is_image