Codex

Function Reference/get post mime type

Contents

Description

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.

Usage

<?php get_post_mime_type$ID ?>

Parameters

$ID
(integer) (optional) Post ID.
Default: ''

Return Values

(boolean|string) 
False on failure or returns the mime type

Examples

Notes

Change Log

Since: 2.0.0

Source File

get_post_mime_type() is located in wp-includes/post.php.

Related

See also index of Function Reference and index of Template Tags.