获取给定帖子类型的所有可用后MIME类型。

原型

get_available_post_mime_types( string $type = 'attachment' )

参数

$type (string) (Optional)

返回值

(mixed)  

源文件

路径:wp-admin/includes/post.php

<?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;
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/get_available_post_mime_types/