[wp-trac] [WordPress Trac] #20672: Mime-Type Matching Error With Certain Added Mime-Types
WordPress Trac
noreply at wordpress.org
Thu May 22 21:16:53 UTC 2014
#20672: Mime-Type Matching Error With Certain Added Mime-Types
--------------------------+------------------------------
Reporter: toneburst | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by ericlewis):
This patch applies clean for me and does the trick.
Here's boilerplate for a plugin to test.
{{{
#!php
<?php
function kml_modify_post_mime_types( $post_mime_types ) {
$post_mime_types['application/vnd.google-earth.kml+xml'] =
array(__('KML'), __('Manage KML'), _n_noop('KML <span
class="count">(%s)</span>', 'KML <span class="count">(%s)</span>'));
return $post_mime_types;
}
add_filter( 'post_mime_types', 'kml_modify_post_mime_types' );
function add_kml_mime_type( $mime_types ) {
$mime_types['kml'] = 'application/vnd.google-earth.kml+xml';
return $mime_types;
}
add_filter( 'mime_types', 'add_kml_mime_type' );
}}}
And then download a
[https://developers.google.com/kml/documentation/KML_Samples.kml random
KML file]. Upload it, and notice the MIME-type tab for KML in the Media
Library tabs.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/20672#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list