-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first time[Feature] TypographyFont and typography-related issues and PRsFont and typography-related issues and PRs[Type] Code QualityIssues or PRs that relate to code qualityIssues or PRs that relate to code quality[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
What?
We could simplify the code by entirely removing the WP_Font_Family_Utils::has_font_mime_type()
function and its tests.
This was a workaround when we didn't have the wp_handle_upload()
mime type checking in place.
gutenberg/lib/experimental/fonts/font-library/class-wp-font-family-utils.php
Lines 87 to 92 in 937d51e
public static function has_font_mime_type( $filepath ) { | |
$filetype = wp_check_filetype( $filepath, WP_Font_Library::ALLOWED_FONT_MIME_TYPES ); | |
return in_array( $filetype['type'], WP_Font_Library::ALLOWED_FONT_MIME_TYPES, true ); | |
} | |
} |
Why?
We can remove it now because it's no longer necessary. The mime type check of the downloaded/uploaded files is done by the core function wp_handle_upload
, and a custom check is no longer required.
Metadata
Metadata
Assignees
Labels
Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first time[Feature] TypographyFont and typography-related issues and PRsFont and typography-related issues and PRs[Type] Code QualityIssues or PRs that relate to code qualityIssues or PRs that relate to code quality[Type] EnhancementA suggestion for improvement.A suggestion for improvement.