add_filter( 'upload_mimes', function( $mimes ) { $mimes['epub'] = 'application/epub+zip'; return $mimes; } ); add_filter( 'wp_check_filetype_and_ext', function( $data, $file, $filename, $mimes ) { $ext = pathinfo( $filename, PATHINFO_EXTENSION ); if ( strtolower( $ext ) === 'epub' ) { $data['ext'] = 'epub'; $data['type'] = 'application/epub+zip'; } return $data; }, 10, 4 );