diff --git a/functions.php b/functions.php index e880ab0..835d1db 100644 --- a/functions.php +++ b/functions.php @@ -31,6 +31,30 @@ function custom_wp_theme_json_default( $theme_json ) { } add_filter( 'wp_theme_json_data_default', 'custom_wp_theme_json_default' ); +// enable svg uploads +add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) { + + global $wp_version; + if ( $wp_version !== '4.7.1' ) { + return $data; + } + + $filetype = wp_check_filetype( $filename, $mimes ); + + return [ + 'ext' => $filetype['ext'], + 'type' => $filetype['type'], + 'proper_filename' => $data['proper_filename'] + ]; + +}, 10, 4 ); +function cc_mime_types($mimes) { + $mimes['svg'] = 'image/svg+xml'; + return $mimes; +} +add_filter('upload_mimes', 'cc_mime_types'); + +// define block styles function jett_block_styles() { register_block_style( 'core/heading',