[wp-trac] [WordPress Trac] #45615: CSV Mime Type fails upload

WordPress Trac noreply at wordpress.org
Mon Jan 7 18:45:38 UTC 2019


#45615: CSV Mime Type fails upload
--------------------------------------+------------------------
 Reporter:  Kloon                     |       Owner:  joemcgill
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  5.0.3
Component:  Upload                    |     Version:  5.0.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------

Comment (by harmr):

 @tellyworth: We use the following code to register the GPX mimetype in our
 plugin Maps Marker Pro:

 {{{
 add_filter('upload_mimes', array($this, 'add_upload_mime_types'));
 public function add_upload_mime_types($mimes) {
     $mimes['gpx'] = 'application/gpx+xml';
     return $mimes;
 }
 }}}

 filtering for gpx files in the media library is added via

 {{{
 add_filter('post_mime_types', array($this, 'add_post_mime_types'));
 public function add_post_mime_types($post_mime_types) {
     $post_mime_types['application/gpx+xml'] = array(
         __('GPX tracks', 'mmp'),
         __('Manage GPX tracks', 'mmp'),
         _n_noop('GPX track <span class="count">(%s)</span>', 'GPX tracks
 <span class="count">(%s)</span>', 'mmp')
     );

     return $post_mime_types;
 }
 }}}

 A minimal sample GPX file can be found at [https://demo.mapsmarker.com/wp-
 content/uploads/2019/01/gpx-sample.zip]

 thanks a lot!

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


More information about the wp-trac mailing list