Created
November 14, 2024 22:02
-
-
Save felipeabajo/1655aa325e38d75c3a8d572b95c0bd23 to your computer and use it in GitHub Desktop.
Allow ICO Mime type in WordPress (functions.php)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*upload ico files */ | |
function upload_ico_files( $types, $file, $filename, $mimes ) { | |
if ( false !== strpos( $filename, '.ico' ) ) { | |
$types['ext'] = 'ico'; | |
$types['type'] = 'image/ico'; | |
} | |
return $types; | |
} | |
add_filter( 'wp_check_filetype_and_ext', 'upload_ico_files', 10, 4 ); | |
function ico_files( $mimes ) { | |
$mimes['ico'] = 'image/ico'; | |
return $mimes; | |
} | |
add_filter( 'upload_mimes', 'ico_files' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment