WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

WordPress has list of allowed Media Library upload extensions in wp-includes/functions.php but is there any way to return them to theme's files as an array?

share|improve this question
Are you using multisite? – shea Dec 4 '12 at 11:03
No. But an option to have both WP and WPMU solutions as an answer to this question would be great :) – Paul Dec 4 '12 at 11:10

get_allowed_mime_types() function returns an array of mime types keyed by the file extension regex corresponding to those types.

share|improve this answer

I believe you're looking for the wp_get_mime_types() function

share|improve this answer
This function is introduced in WP3.5 and is not available in current stable release 3.4.x. – Parham Dec 4 '12 at 11:39
@Parham Thanks - I wasn't aware of this. Do you know if this function will be preferred over get_allowed_mime_types() when 3.5 is released? – shea Dec 4 '12 at 11:43
according to the source code, wp_get_mime_types() returns the list of ALL mime types and applies the 'mime_types' filter on the list. The filter should be used to add types, not remove them. get_allowed_mime_types() returns a list of allowed mime types, it uses wp_get_mime_types() to fetch the list but applies one more filter: 'upload_mimes' which can be used to remove types. – Parham Dec 4 '12 at 11:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.