esw_add_support()
Adds svg = image/svg+xml to the allowed upload types.
Function · Easy SVG · Status: Internal · Defined in easy-svg.php
Internal: not part of the promised public surface. It may change without notice.
Usage
esw_add_support( array $mimes ): array
Example
$mimes = esw_add_support( get_allowed_mime_types() );
Description
Hooked on upload_mimes while SVG uploads are on. On multisite it adds svg only when the network's upload_filetypes lists it, unless easy_svg_respect_network_filetypes returns false. The function is pluggable: when one with this name exists before the plugin loads, the plugin neither defines nor hooks its own.
Parameters
body
$mimesarray
Extension to MIME type map.
Return value
returnarray
The map, with svg when allowed.
Defining your own
esw_add_support() also removes the plugin's upload_mimes hook, so you must hook yours yourself.Related
Was this page helpful?