function get_post_field( $field,
$post = null,
$context = 'display'
) { $post =
get_post( $post );
if ( !
$post ) { return '';
} if ( !
isset( $post->
$field ) ) { return '';
} return sanitize_post_field( $field,
$post->
$field,
$post->ID,
$context );
}/**
* 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.
*
* @since 2.0.0
*
* @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
* @return string|false The mime type on success, false on failure.
*/