get_available_post_mime_types()
最后更新于:2021-11-26 05:14:20
get_available_post_mime_types( string$type=’attachment’)Get all available post MIME types for a given post type.
参数
- $type
-
(string) (Optional)
Default value: ‘attachment’
响应
(mixed)
源文件
文件: gc-includes/post.php
function get_available_post_mime_types( $type = 'attachment' ) {
global $gcdb;
$types = $gcdb->get_col( $gcdb->prepare( "SELECT DISTINCT post_mime_type FROM $gcdb->posts WHERE post_type = %s", $type ) );
return $types;
}