get_allowed_mime_types

The timeline below displays how wordpress function get_allowed_mime_types has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Retrieves the list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @param int|WP_User $user Optional. User to check. Defaults to current user.
 * @return string[] 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'], $t['js']);
    }
    /**
     * Filters the 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.
     * @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);
}

WordPress Version: 5.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @param int|WP_User $user Optional. User to check. Defaults to current user.
 * @return string[] 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'], $t['js']);
    }
    /**
     * Filters 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.
     * @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);
}

WordPress Version: 9.1

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * Filters 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);
}

WordPress Version: 4.9

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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']);
    }
    /**
     * Filters 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);
}

WordPress Version: 8.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * Filters 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);
}

WordPress Version: 8.2

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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']);
    }
    /**
     * Filters 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);
}

WordPress Version: .10

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * Filters 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);
}

WordPress Version: 4.7

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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']);
    }
    /**
     * Filters 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);
}

WordPress Version: 6.9

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * Filters 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);
}

WordPress Version: 6.3

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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']);
    }
    /**
     * Filters 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);
}

WordPress Version: .20

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * Filters 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);
}

WordPress Version: 6.2

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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']);
    }
    /**
     * Filters 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);
}

WordPress Version: .10

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * Filters 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);
}

WordPress Version: 4.6

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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']);
    }
    /**
     * Filters 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);
}

WordPress Version: 5.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .30

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 5.3

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .20

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 5.2

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .12

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 4.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .30

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 4.3

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .20

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 4.2

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .13

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 3.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .30

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 3.3

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .20

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 3.2

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .14

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 2.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .30

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 2.3

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .20

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 2.2

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .18

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 1.5

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .40

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 1.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .30

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 1.3

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: .21

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 4.1

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @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);
}

WordPress Version: 0.4

/**
 * 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);
}

WordPress Version: .30

/**
 * 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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 0.3

/**
 * 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);
}

WordPress Version: .21

/**
 * 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'], $t['js']);
    }
    /**
     * 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);
}

WordPress Version: 4.0

/**
 * 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);
}

WordPress Version: 3.9

/**
 * 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);
}

WordPress Version: 8.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: .30

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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'], $t['js']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: 8.3

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: .24

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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'], $t['js']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: 7.5

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: .40

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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'], $t['js']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: 7.4

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: .30

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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'], $t['js']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: 7.3

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: .24

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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'], $t['js']);
    }
    return apply_filters('upload_mimes', $t, $user);
}

WordPress Version: 3.7

/**
 * Retrieve list of allowed mime types and file extensions.
 *
 * @since 2.8.6
 *
 * @uses apply_filters() Calls 'upload_mimes' on returned array
 * @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']);
    }
    return apply_filters('upload_mimes', $t, $user);
}