get_available_post_mime_types( string $type = 'attachment' )
Get all available post MIME types for a given post type.
Description Description
Parameters Parameters
- $type
-
(string) (Optional)
Default value: 'attachment'
Return Return
(mixed)
Source Source
File: wp-includes/post.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;
}
Expand full source code Collapse full source code View on Trac
Changelog Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |