WP_REST_Attachments_Controller::get_media_types() protected WP 4.7.0
Retrieves the supported media types.
Media types are considered the MIME type category.
{} Это метод класса: WP_REST_Attachments_Controller{}
Хуков нет.
Возвращает
Массив
. Array of supported media types.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_media_types();
Список изменений
С версии 4.7.0 | Введена. |
Код WP_REST_Attachments_Controller::get_media_types() WP REST Attachments Controller::get media types WP 5.7.1
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;
}