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 comment