Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webfonts: register and enqueue fonts by font-family #39559

Merged
merged 17 commits into from
Apr 4, 2022

Commits on Apr 4, 2022

  1. Configuration menu
    Copy the full SHA
    130fb24 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7ad1a8e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f061bdf View commit details
    Browse the repository at this point in the history
  4. Add wp_enqueue_webfont method

    zaguiini authored and hellofromtonya committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    000c8ec View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f1971d4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    009d2b2 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    826a94b View commit details
    Browse the repository at this point in the history
  8. Add tests

    zaguiini authored and hellofromtonya committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    bbb8197 View commit details
    Browse the repository at this point in the history
  9. Fix linter offenses

    zaguiini authored and hellofromtonya committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    e1ea79f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    bf7b349 View commit details
    Browse the repository at this point in the history
  11. Move webfonts logic from wordpress-6.0 to experimental

    The API, although looking really good, is not ready for Core.
    So we must move it from wordpress-6.0 to experimental,
    and only add it there when it's ready to enter WordPress.
    
    Relocate files to /lib/experimental.
    
    Per the Gutenberg PHP > File structure documentation
    https://github.com/WordPress/gutenberg/tree/trunk/lib#file-structure.
    zaguiini authored and hellofromtonya committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    340df68 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9fe1f80 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6fba7fb View commit details
    Browse the repository at this point in the history
  14. Fix tests with _doing_it_wrong.

    Tests for methods that have a `_doing_it_wrong()` require
    an `expectedIncorrectUsage` annotation, proper usage of test fixture methods,
    and the usage of `__METHOD__` when invoking `_doing_it_wrong()`.
    
    This commit:
    
    - Fixes the test fixtures to use snake_case format and calling of the parent fixtures.
    - Refactors `get_font_slug()` tests into data providers (preferred in Core) and separates tests that will trigger `_doing_it_wrong()` to use the annotation.
    - Uses `__METHOD__` instead of `__FUNCTION__` in each `_doing_it_wrong()` instance.
    hellofromtonya committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    8392827 View commit details
    Browse the repository at this point in the history
  15. 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.
    hellofromtonya committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    6d66272 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    90cc444 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    cc63012 View commit details
    Browse the repository at this point in the history