$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'); /* Remove default CSS variables that come with Wordpress https://github.com/WordPress/gutenberg/issues/56180#issuecomment-1819222376 */ function custom_wp_theme_json_default( $theme_json ) { $new_data = array( 'version' => 2, 'settings' => array( 'color' => array( 'palette' => array(), 'gradients' => array(), ), 'shadow' => array( 'presets' => array(), ), 'typography' => array( 'fontSizes' => array(), ), // 'dimensions' => array( // 'aspectRatios' => array(), // ), // 'spacing' => array( // 'spacingScale' => array( // 'steps' => 0, // ), // ), ), ); return $theme_json->update_with( $new_data ); } add_filter( 'wp_theme_json_data_default', 'custom_wp_theme_json_default' ); // remove default woocommerce fonts add_filter('wp_theme_json_data_theme', 'disable_inter_font', 100); function disable_inter_font($theme_json) { $theme_data = $theme_json->get_data(); $font_data = $theme_data['settings']['typography']['fontFamilies']['theme'] ?? array(); // The font name to be removed $font_names = ['Inter', 'Cardo']; $font_names_total = 2; $font_names_found = 0; // Check if 'Inter' font exists foreach ($font_data as $font_key => $font) { if (isset($font['name']) && in_array($font['name'], $font_names)) { // Increment found font names $font_names_found++; // Remove the font unset($font_data[$font_key]); // Update font data $theme_json->update_with(array( 'version' => 1, 'settings' => array( 'typography' => array( 'fontFamilies' => array( 'theme' => $font_data, ), ), ), )); if ($font_names_found === $font_names_total) { break; } } } return $theme_json; }