- Timestamp:
- 09/10/2013 06:03:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r25313 r25317 2024 2024 * @uses wp_get_upload_mime_types() to fetch the list of mime types 2025 2025 * 2026 * @param int|WP_User $user Optional. User to check. Defaults to current user. 2026 2027 * @return array Array of mime types keyed by the file extension regex corresponding to those types. 2027 2028 */ 2028 function get_allowed_mime_types() { 2029 return apply_filters( 'upload_mimes', wp_get_mime_types() ); 2029 function get_allowed_mime_types( $user = null ) { 2030 $t = wp_get_mime_types(); 2031 2032 unset( $t['swf'], $t['exe'] ); 2033 $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' ); 2034 if ( ! $unfiltered ) 2035 unset( $t['htm|html'] ); 2036 2037 return apply_filters( 'upload_mimes', $t, $user ); 2030 2038 } 2031 2039
Note: See TracChangeset
for help on using the changeset viewer.