upload_mimes filter-hook . WP 2.0.0
Filters list of allowed mime types and file extensions.
Usage
add_filter( 'upload_mimes', 'filter_function_name_382', 10, 2 ); function filter_function_name_382( $t, $user ){ // filter... return $t; }
- $t(array)
- Mime types keyed by the file extension regex corresponding to those types.
- $user(int/WP_User/null)
- User ID, User object or null if not provided (indicates current user).
Changelog
Since 2.0.0 | Introduced. |
Where the hook is called
upload_mimes
wp-includes/functions.php 3260
return apply_filters( 'upload_mimes', $t, $user );
Where in WP core the hook is used WordPress
wp-includes/functions.php 98
add_filter( 'upload_mimes', 'check_upload_mimes' );