Uses
| Uses | Description |
|---|---|
| wp-includes/wp-db.php: wpdb::get_col() | Retrieves one column from the database. |
| wp-includes/wp-db.php: wpdb::prepare() | Prepares a SQL query for safe execution. |
Get all available post MIME types for a given post type.
(string) (Optional)
Default value: 'attachment'
(mixed)
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;
} | Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_available_post_mime_types