Skip to content

Instantly share code, notes, and snippets.

@lukebussey
Created February 21, 2020 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukebussey/79b54deeb3e499069c853b46589b63b9 to your computer and use it in GitHub Desktop.
Save lukebussey/79b54deeb3e499069c853b46589b63b9 to your computer and use it in GitHub Desktop.
Add Custom Font Formats to Divi 4
/* Mime Types Support */
add_filter('upload_mimes', 'custom_mime_types', 999999);
function custom_mime_types($mimes) {
$mimes['otf'] = 'application/x-font-opentype';
$mimes['woff'] = 'application/font-woff';
$mimes['woff2'] = 'application/font-woff2';
return $mimes;
}
/* Custom Font Types Support */
add_filter('et_pb_supported_font_formats', 'custom_font_formats', 1);
function custom_font_formats() {
return array('otf', 'woff', 'woff2');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment