WordPress.org

Make WordPress Core

#21410 closed enhancement (invalid)

Misleading function description for check_upload_mimes

Reported by: Cimmo Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.1
Component: Multisite Keywords:
Focuses: 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 SergeyBiryukov21 months ago

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

comment:2 Cimmo21 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 SergeyBiryukov19 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.