関数 get_allowed_mime_types()
定義ファイル :/blog/wp-includes/functions.php 12
get_allowed_mime_types()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | /** * Retrieve list of allowed mime types and file extensions. * * @since 2.8.6 * * @uses wp_get_upload_mime_types() to fetch the list of mime types * * @param int|WP_User $user Optional. User to check. Defaults to current user. * @return array Array of mime types keyed by the file extension regex corresponding * to those types. */ function get_allowed_mime_types( $user = null ) { $t = wp_get_mime_types(); unset( $t['swf'], $t['exe'] ); if ( function_exists( 'current_user_can' ) ) $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' ); if ( empty( $unfiltered ) ) unset( $t['htm|html'] ); /** * Filter list of allowed mime types and file extensions. * * @since 2.0.0 * * @param array $t Mime types keyed by the file extension regex corresponding to * those types. 'swf' and 'exe' removed from full list. 'htm|html' also * removed depending on '$user' capabilities. * @param int|WP_User|null $user User ID, User object or null if not provided (indicates current user). */ return apply_filters( 'upload_mimes', $t, $user ); } |