Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ai-mu-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Noblogs
ai-mu-plugins
Commits
b2e4d8f0
Commit
b2e4d8f0
authored
1 year ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Allow upload of epub files via mime-type fix
parent
f84a4162
Branches
Branches containing commit
Tags
v0.4.14
Tags containing commit
No related merge requests found
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
upload-mime-types.php
+13
-0
13 additions, 0 deletions
upload-mime-types.php
with
13 additions
and
0 deletions
upload-mime-types.php
+
13
−
0
View file @
b2e4d8f0
...
...
@@ -27,3 +27,16 @@ add_filter( 'wp_check_filetype_and_ext', function( $types, $file, $filename, $mi
}
return
$types
;
},
1
,
5
);
/* Allow upload of other MIME types.
*
* These are easier as there's no possibility of misidentification.
*/
function
ai_mu_edit_upload_types
(
$existing_mimes
=
array
())
{
// allow .epub
$existing_mimes
[
'epub'
]
=
'application/epub+zip'
;
return
$existing_mimes
;
}
add_filter
(
'upload_mimes'
,
'ai_mu_edit_upload_types'
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment