get_post_mime_type
get_post_mime_type ( $post = null )
Parameters:- (int|WP_Post) post Optional. Post ID or post object. Defaults to global $post.
Returns:- (string|false) The mime type on success, false on failure.
Defined at: - Introduced in WordPress: 2.0.0
- Deprecated in WordPress: —
Description
Retrieves the mime type of an attachment based on the ID.This function can be used with any post type, but it makes more sense with
attachments.