• Hello,
    Since the last update of my wordpress, i have some problem with the media library.
    I can’t send file with the extension “.kml” (google map).
    I found anything in the documentation, if someone have an idea and how i can fix it ? tkx

Viewing 1 replies (of 1 total)
  • Thread Starter KubX

    (@kubx)

    i have found the solution :

    <?php
    // Add the new filter
    add_filter('upload_mimes', 'addUploadMimes');
    
    /**
     * Adds new supported media types for upload.
     *
     * @see wp_check_filetype() or get_allowed_mime_types()
     * @param array $mimes Array of mime types keyed by the file extension regex corresponding to those types.
     * @return array
     */
    function addUploadMimes($mimes)
    {
    	$mimes = array_merge($mimes, array(
    		'kml' => 'application/octet-stream'
    	));
    
    	return $mimes;
    }
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Media Library’ is closed to new replies.