Home / functions.php / Display list of allowed mime types get_allowed_mime_types
  • How to Display list of allowed mime types get_allowed_mime_types

    display-list-of-allowed-mime-types-get_allowed_mime_types

    Adding this snippet to your wordpress theme will display a list of available mime types allowed by wordpress.

    ( click code to copy )

    wordpress snippet : PHP

    <>
         $mimes = get_allowed_mime_types();
         $types = array();
    foreach ($mimes as $ext => $mime) {
         $types[] = '<li>' . str_replace('|', ', ', $ext) . '</li>';
    }
         echo '<ul>' . implode('', $types) . '</ul>';
    

    ( WordPress codex functions, hooks, in this snippet. )