get_post_mime_type


get_post_mime_type ( $post = null )

Parameters:
  • (int|WP_Post) post Optional. Post ID or post object. Defaults to global $post.
Returns:
  • (string|bool) The mime type on success, false on failure.
Defined at:

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.

Related Functions

get_post_mime_types, get_post_type, get_post_types, get_post_timestamp, set_post_type

Top Google Results

User discussions

wpseek mobile