Opened 10 months ago
Closed 7 months ago
#21410 closed enhancement (invalid)
Misleading function description for check_upload_mimes
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Multisite | Version: | 3.4.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The description for check_upload_mimes is misleading.
Specifically "This function is used to filter that list against..." for that list seems talks about what returned by get_allowed_mime_types() but this is not true, since there is no call to get_allowed_mime_types() in the code.
Instead filter $mimes input array against the filetype whitelist provided by Multisite.
Please fix the description.
/**
* Check an array of MIME types against a whitelist.
*
* WordPress ships with a set of allowed upload filetypes,
* which is defined in wp-includes/functions.php in
* get_allowed_mime_types(). This function is used to filter
* that list against the filetype whitelist provided by Multisite
* Super Admins at wp-admin/network/settings.php.
*
* @since MU
*
* @param array $mimes
* @return array
*/
function check_upload_mimes( $mimes ) {
Change History (3)
comment:1
SergeyBiryukov — 10 months ago
Oh ok, wasn't clear enough since I couldn't find documentation on codex, probably because nobody really needs to call it from their plug-in.
comment:3
SergeyBiryukov — 7 months ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.

Related: #20997
The description appears to be correct.
check_upload_mimes() is hooked to upload_mimes filter, which is used in get_allowed_mime_types():
http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/ms-default-filters.php#L46
http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/functions.php#L1755