DIVI
Add Woff Support to Divi
Last updated 8 months ago
PHP
PHPCS Compliant
/**
* Add WordPress Custom MIME Type Support.
* $mimes Array of MIME Types.
*
*/
function hlabs_custom_mime_types( $mimes ) {
$mimes['otf'] = 'application/x-font-opentype';
$mimes['woff'] = 'application/font-woff';
$mimes['woff2'] = 'application/font-woff2';
return $mimes;
}
add_filter('upload_mimes', 'hlabs_custom_mime_types', 999999);
/*
* Add Custom Font Type Support to Divi.
*/
function custom_font_formats() {
return array('otf', 'woff', 'woff2');
}
add_filter('et_pb_supported_font_formats', 'custom_font_formats', 1);
All code snippets are licensed GPLv2 or later unless otherwise stated.