WordPress at a glance
function is not described

get_available_post_mime_types() WP 2.5.0

Get all available post MIME types for a given post type.

No Hooks.

Return

Mixed. Null. Nothing.

Usage

get_available_post_mime_types( $type );
$type(string)
-

Notes

  • Global. wpdb. $wpdb WordPress database abstraction object.

Changelog

Since 2.5.0 Introduced.

Code of get_available_post_mime_types() WP 5.7

<?php
function get_available_post_mime_types( $type = 'attachment' ) {
	global $wpdb;

	$types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type ) );
	return $types;
}