Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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? –  bungeshea Dec 4 '12 at 11:03
1  
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
add comment

2 Answers

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

share|improve this answer
1  
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? –  bungeshea Dec 4 '12 at 11:43
2  
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
add comment

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
add comment

Your Answer

 
discard

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.