get_post_mime_type

Definition:
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.

Parameters

  • 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;

}

1597

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:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: