Enable font mimetypes for upload
PBF has a custom typography option that allows you to upload a font file…except font files aren’t default-allowed on WP, and the function.php for this theme doesn’t have the code to enable font mimetypes. That means I either need to make a child theme, or I need to go install a custom typography plugin…which seems like it should be unnecessary what with custom typography being a built-in feature of this theme.
3 thoughts on “Enable font mimetypes for upload”
Leave a Reply
3 thoughts on “Enable font mimetypes for upload”
-
Hi,
what mime-types are you missing?
With the Premium Add-On installed we add the following mime-types to the upload-mimes:
/** * Allow font uploads. * * @param array $mime_types The mime types. * * @return array The updated mime types. */ function wpbf_add_custom_upload_mimes( $mime_types ) { $mime_types['otf'] = 'application/x-font-otf'; $mime_types['woff'] = 'application/x-font-woff'; $mime_types['woff2'] = 'application/x-font-woff2'; $mime_types['ttf'] = 'application/x-font-ttf'; $mime_types['svg'] = 'image/svg+xml'; $mime_types['eot'] = 'application/vnd.ms-fontobject'; return $mime_types; } add_filter( 'upload_mimes', 'wpbf_add_custom_upload_mimes', 0 ); -
I was trying to upload a TTF, and it wasn’t allowing it. Interesting. Maybe it’s a bug?
-
I’m closing this for now as we basically have this already in place.
Can you please open a ticket and attach the TTF file that you’ve tried to upload? I’m going to try to replicate & debug this.
https://wp-pagebuilderframework.com/support/
Thanks! 🙂
Comments are closed.

Hi,
what mime-types are you missing?
With the Premium Add-On installed we add the following mime-types to the upload-mimes:
I was trying to upload a TTF, and it wasn’t allowing it. Interesting. Maybe it’s a bug?
I’m closing this for now as we basically have this already in place.
Can you please open a ticket and attach the TTF file that you’ve tried to upload? I’m going to try to replicate & debug this.
https://wp-pagebuilderframework.com/support/
Thanks! 🙂