[wp-trac] [WordPress Trac] #32693: wp_enqueue_media() : upload_mimes not filtering

WordPress Trac noreply at wordpress.org
Wed Jun 24 00:11:15 UTC 2015


#32693: wp_enqueue_media() : upload_mimes not filtering
-------------------------------+------------------------------
 Reporter:  jbonnier           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  2.0
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => reporter-feedback
 * version:  4.2.2 => 2.0


Comment:

 Thanks for the report, @jbonnier.

 I'm unable to reproduce this issue. The following code behaves as
 expected:

 {{{
 function images_upload_mimes( $mimes = array() )
 {
         $mimes = array(
                 'jpg|jpeg|jpe' => 'image/jpeg',
                 'gif' => 'image/gif',
                 'png' => 'image/png',
         );
         return $mimes;
 }
 add_filter( 'upload_mimes', 'images_upload_mimes' );
 }}}

 In your example code, where is the `file_uploader` method triggered? Is it
 hooked onto an action such as `init`? If not, that is probably the cause
 of your problem.

 Replying to [comment:1 steve@…]:
 > {{{
 > add_filter('upload_mime_types','remove_pdf');
 > }}}
 The correct filter name is `upload_mimes`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32693#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list