Filter PDF files in the file loader

By default, WordPress is able to identify 2 types of file in the file loader and multimedia library : images and videos.

In this way, when you upload a file of this type WordPress you can display a filter in the media loader so that you can identify them more quickly.

Now, if you use many PDF files you may be interested in having WordPress identify them and, also, allow you to filter files of this type and thus locate them more quickly to insert them in your content.

what you need just add this code to your function plugin or to the file functions.php of your active topic:

You save the changes and you already have them. If you want to add another type of file you can do the same with the mimes registered in the file ' /wp-includes/functions.php ', looking for the string ' get_allowed_mime_types ( ) ', where you'll find something like this:

You choose from the list the type of mime to add and add it as in the array of the above code.

What we get is to move on from this …

… to this other:

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

Add file types that can be uploaded • WordPress Help

If we already have clear file extensions that we want to add in order for WordPress to upload them, we just have to enter them in this code that will go, guess it, in the file functions.php of your active topic:

] In this case I wanted to add the file types .pages .numbers and .key of the office suite Apple iWork initially not supported by WordPress, but you can adapt it to your needs, simply by putting there your file extensions to add (without the point).