Uses
Uses | Description |
---|---|
wp-includes/functions.php: get_allowed_mime_types() | Retrieve list of allowed mime types and file extensions. |
Retrieves the supported media types.
Media types are considered the MIME type category.
(array) Array of supported media types.
File: wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
protected function get_media_types() { $media_types = array(); foreach ( get_allowed_mime_types() as $mime_type ) { $parts = explode( '/', $mime_type ); if ( ! isset( $media_types[ $parts[0] ] ) ) { $media_types[ $parts[0] ] = array(); } $media_types[ $parts[0] ][] = $mime_type; } return $media_types; }
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_attachments_controller/get_media_types