Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Ed

    (@coopeh)

    Anyone else interested in this can add the following to the plugin, although there are actually plugins out there that do the same. Would be nice to add either another text file to add exclusions to or write an admin page for it.

    add_filter('upload_mimes', 'restrict_mime');
    function restrict_mime($mimes) {
    $mimes = array(
                    'mp3' => 'audio/x-mpeg'
    );
    return $mimes;
    }

    This will block MP3’s being uploaded unless the user has unfiltered uploads on their account.

    Plugin Author Josh Maxwell

    (@hornetok)

    Nice one, Ed!

    I’m working on adding a Settings page to edit the text file. I’ll see what I can do to get your filter added in, too!

    Cheers!

    Thread Starter Ed

    (@coopeh)

    Cool, I’d double check that code though. Think it broke all uploads when I used it, needs tweaking. Will update when I get a chance to test it again.

    @ed: Why dont you just go to your network settings and delete those file types you dont like?

    Thread Starter Ed

    (@coopeh)

    I think I tried that and it still allowed them due to WordPress’s defaults.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: AP Extended MIME Types] Idea: Exclude file types’ is closed to new replies.