jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Filter local theme-provided fonts from the Google Font Provider

Open pbking opened this issue 3 years ago • 2 comments

Fixes #25987

Changes proposed in this Pull Request:

  • Gets a list of fonts provided by the theme via theme.json
  • Filters list of fonts to provide to not include fonts already provided by the theme

Other information:

Ideally this change would use wp_webfonts()->get_registered_webfonts() to determine the webfonts supplied by theme.json. However that doesn't seem to include those fonts so wp_get_global_settings() was used instead.

  • [ ] Have you written new tests for your changes, if applicable?
  • [ ] Have you checked the E2E test CI results, and verified that your changes do not break them?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Activate the theme Pendant (which includes opinionated 'Literata' font)
  • Load any page and observe where the fonts are loaded from (they should now be loaded from the theme rather than from the Google Font CDN).

pbking avatar Sep 29 '22 18:09 pbking

Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run bin/jetpack-downloader test jetpack fix/25987-filter-local-fonts-from-google-fonts-provider to get started. More details: p9dueE-5Nn-p2

github-actions[bot] avatar Sep 29 '22 18:09 github-actions[bot]

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • :white_check_mark: Include a description of your PR changes.
  • :white_check_mark: All commits were linted before commit.
  • :red_circle: Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • :white_check_mark: Add testing instructions.
  • :white_check_mark: Specify whether this PR includes any changes to data or privacy.
  • :red_circle: Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


:red_circle: Action required: Please add missing changelog entries for the following projects: projects/plugins/jetpack

Use the Jetpack CLI tool to generate changelog entries by running the following command: jetpack changelog add. Guidelines: /docs/writing-a-good-changelog-entry.md


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team review" label and ask someone from your team review the code. Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: January 3, 2023.
  • Scheduled code freeze: December 26, 2022.

github-actions[bot] avatar Sep 29 '22 18:09 github-actions[bot]