function get_post_mime_type($ID = '') {}

Retrieve 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.


  • int $ID: Optional. Post ID.

Return values

returns:False on failure or returns the mime type

Source code

function get_post_mime_type($ID = '') {

	$post = & get_post($ID);

	if ( is_object($post) )

		return $post->post_mime_type;

	return false;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: