• Hi,

    I want to extend supported mime types to allow .scn files. I’ve used the following code and it doesn’t work. Any suggestions would be greatly apreciated!

    <?php
    
    add_filter( 'upload_mimes', 'amce_add_scn_support' );
    /**
     * @param  array $mimes The current array of MIME types that are supported.
     * @return array $mimees The updated array of supported MIME types.
     */
    function amce_add_scn_support( $mimes ) {
    
    	$mimes = array_merge(
    		$mimes,
    		array(
    			'scn' => 'application/octet-stream',
    		)
    	);
    
    	return $mimes;
    
    }
    • This topic was modified 7 years, 6 months ago by bcworkz. Reason: code fixed
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Your code works on my site. At least a file with that extension can be uploaded. A generic icon is displayed for it. Getting the correct icon is a different filter: “wp_mime_type_icon”. How is it not working for you? You may have a plugin or theme conflict. Verify by deactivating plugins or switching themes.

    To ensure your code is usable for possible testing by others, always enclose your code in `backticks`, or use the ‘code’ button. Failing to do so messes up the proper quote characters. As a mod, I’m able to easily fix your code. Other members are not able to do so. They may decide helping you is too much hassle.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding mime types’ is closed to new replies.