Desde la versión de WordPress 4.7.1 o superior, se agregó un control de seguridad adicional para los tipos mime. Simplemente agregue el siguiente fragmento de código en functions.php de su tema activo para lograr lo anterior:
function modify_upload_mimes ( $mimes_types ) {
// add your extension to the mimes array as below
$mimes_types['zip'] = 'application/zip';
$mimes_types['gz'] = 'application/x-gzip';
return $mimes_types;
}
add_filter( 'upload_mimes', 'modify_upload_mimes', 99 );
function add_allow_upload_extension_exception( $types, $file, $filename, $mimes ) {
// Do basic extension validation and MIME mapping
$wp_filetype = wp_check_filetype( $filename, $mimes );
$ext = $wp_filetype['ext'];
$type = $wp_filetype['type'];
if( in_array( $ext, array( 'zip', 'gz' ) ) ) { // it allows zip files
$types['ext'] = $ext;
$types['type'] = $type;
}
return $types;
}
add_filter( 'wp_check_filetype_and_ext', 'add_allow_upload_extension_exception', 99, 4 );
Para más info visita mi blog enlace
.