-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
get_webfonts_by_provider()
method to handle regrouping.
The `WP_Webfonts::generate_styles()` should not be aware of how to reorganize the webfonts from grouped by font-family to grouped by provider. Why? This is a separate task from generating styles for the webfonts. This commit creates a private method called `get_webfonts_by_provider()` to encapsulate the know-how for this reorganizational work. It also includes a micro-optimization that eliminates an extra `foreach` loop and the building of an unnecessary `$webfonts` array of arrays.
- Loading branch information
1 parent
4266deb
commit 03a4db8
Showing
2 changed files
with
41 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters