Opened 14 years ago
Closed 14 years ago
#20990 closed enhancement (fixed)
Add filter information to get_allowed_mime_types() inline docs
| Reported by: | lspcity | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Inline Docs | Version: | 3.4 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
In /wp-includes/functions.php there exists a function named get_allowed_mime_types().
In this function, all allowed mime types are hard-coded. There is no way to extend the list of mime types. So it's not possible to upload svg-files.
Please add SVG-files to this list:
'svg' => 'image/svg+xml',
Attachments (1)
Change History (7)
#3
@
14 years ago
No worries - doc block should probably be updated to reflect the filter being used. Patch attached.
#4
@
14 years ago
- Component Upload → Inline Docs
- Keywords has-patch commit added
- Milestone Awaiting Review → 3.5
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The list is filtered.
You can add the functionality with a very minimal plugin.
function js_add_mime_type( $mime_types ) { return array_merge( $mime_types, array( 'svg' => 'image/svg+xml' ) ); } add_filter( 'upload_mimes', 'js_add_mime_type' );