Skip to content

Commit 66a940a

Browse files
committed
Remove mime type additions for later.
1 parent 515afda commit 66a940a

3 files changed

Lines changed: 0 additions & 36 deletions

File tree

src/wp-includes/functions.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3520,7 +3520,6 @@ function wp_filesize( $path ) {
35203520
* Retrieve list of allowed mime types and file extensions.
35213521
*
35223522
* @since 2.8.6
3523-
* @since 6.0.0 Removes web font from allowed mime types for uploads.
35243523
*
35253524
* @param int|WP_User $user Optional. User to check. Defaults to current user.
35263525
* @return string[] Array of mime types keyed by the file extension regex corresponding
@@ -3530,8 +3529,6 @@ function get_allowed_mime_types( $user = null ) {
35303529
$t = wp_get_mime_types();
35313530

35323531
unset( $t['swf'], $t['exe'] );
3533-
// Remove web font mime types for uploads.
3534-
unset( $t['woff2'], $t['woff'], $t['ttf'], $t['eot'], $t['otf'] );
35353532

35363533
if ( function_exists( 'current_user_can' ) ) {
35373534
$unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );

src/wp-includes/script-loader.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3519,27 +3519,7 @@ function _wp_theme_json_webfonts_handler() {
35193519
wp_add_inline_style( 'wp-block-library', $styles );
35203520
};
35213521

3522-
/**
3523-
* Adds webfonts mime types.
3524-
*
3525-
* @since 6.0.0
3526-
*
3527-
* @param array $mime_types Array of mime types.
3528-
* @return array Mime types with webfonts formats.
3529-
*/
3530-
$fn_add_mime_types = static function( $mime_types ) {
3531-
// Webfonts formats.
3532-
$mime_types['woff2'] = 'font/woff2';
3533-
$mime_types['woff'] = 'font/woff';
3534-
$mime_types['ttf'] = 'font/ttf';
3535-
$mime_types['eot'] = 'application/vnd.ms-fontobject';
3536-
$mime_types['otf'] = 'application/x-font-opentype';
3537-
3538-
return $mime_types;
3539-
};
3540-
35413522
add_action( 'wp_loaded', $fn_register_webfonts );
35423523
add_action( 'wp_enqueue_scripts', $fn_generate_and_enqueue_styles );
35433524
add_action( 'admin_init', $fn_generate_and_enqueue_editor_styles );
3544-
add_filter( 'mime_types', $fn_add_mime_types );
35453525
}

tests/phpunit/tests/webfonts/wpThemeJsonWebfontsHandler.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,4 @@ public function test_font_face_generated_from_themejson() {
9696
get_echo( 'wp_print_styles' )
9797
);
9898
}
99-
100-
/**
101-
* @ticket 55567
102-
* @ticket 46370
103-
*/
104-
public function test_mime_types_added() {
105-
$actual = wp_get_mime_types();
106-
107-
$this->assertArrayHasKey( 'woff2', $actual, 'woff2 mime type is expected to be added' );
108-
$this->assertArrayHasKey( 'woff', $actual, 'woff mime type is expected to be added' );
109-
$this->assertArrayHasKey( 'ttf', $actual, 'ttf mime type is expected to be added' );
110-
$this->assertArrayHasKey( 'otf', $actual, 'otf mime type is expected to be added' );
111-
}
11299
}

0 commit comments

Comments
 (0)