instagram rss arrow-down

This snippet let’s you add or remove allowed file types in the WordPress upload popup. Adding font files like .woff are not allowed by default and this fixes that.

Code Snippet:

function edit_upload_types($existing_mimes = array()) {
    // allow .woff
    $existing_mimes['woff'] = 'font/woff';

    // add as many as you want with the same syntax

    // disallow .jpg files
    unset( $existing_mimes['jpg'] );

    return $existing_mimes;
}
add_filter('upload_mimes', 'edit_upload_types');

Source link

Support New Articles with a Sweet Tee

Leave a Reply
Your email address will not be published. Required fields are marked *

*

*