Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




check_upload_mimes [ WordPress Function ]

check_upload_mimes ( $mimes )
Parameters:
  • (array) $mimes
Returns:
  • (array)
Defined at:



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.

Source


<?php
function check_upload_mimes$mimes ) {
    
$site_exts explode' 'get_site_option'upload_filetypes' ) );
    foreach ( 
$site_exts as $ext ) {
        foreach ( 
$mimes as $ext_pattern => $mime ) {
            if ( 
$ext != '' && strpos$ext_pattern$ext ) !== false )
                
$site_mimes[$ext_pattern] = $mime;
        }
    }
    return 
$site_mimes;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics