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

Font Face API: use gutenberg_get_global_settings instead of private API #53805

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Aug 18, 2023

Part of #41479.

What

This substitutes the call to a private API WP_Theme_JSON_Resolver_Gutenberg::get_merged_data()->get_settings(); for the public API equivalent gutenberg_get_global_settings().

Why

We should use our public APIs when possible.

How to test

Verify all tests pass.

@github-actions
Copy link

github-actions bot commented Aug 18, 2023

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face-resolver.php

@hellofromtonya
Copy link
Contributor

The Font Face files are being relocated to prepare for merging into Core. Once #53858 is merged, then I'll circle back to this PR to get it updated.

@hellofromtonya hellofromtonya added the [Feature] Typography Font and typography-related issues and PRs label Aug 22, 2023
@oandregal oandregal force-pushed the update/usage-of-global-settings branch from 3a14a2c to 8ec62ce Compare August 23, 2023 08:01
@oandregal
Copy link
Member Author

#53805 has been merged, so I rebased this PR.

@hellofromtonya hellofromtonya merged commit 163112f into trunk Aug 23, 2023
49 checks passed
@hellofromtonya hellofromtonya deleted the update/usage-of-global-settings branch August 23, 2023 14:55
@hellofromtonya
Copy link
Contributor

Tested - same results with this PR. Thank you @oandregal!

@github-actions github-actions bot added this to the Gutenberg 16.6 milestone Aug 23, 2023
hellofromtonya added a commit to hellofromtonya/wordpress-develop that referenced this pull request Aug 23, 2023
Changes the resolver to use wp_get_global_settings() instead of
the chained objects to get the merged data layer.

Reference:
WordPress/gutenberg#53805

Props @oandregal.
@hellofromtonya
Copy link
Contributor

hellofromtonya commented Aug 23, 2023

This PR has been backported to WordPress Core.

I added it to the Core PR WordPress/wordpress-develop@e1da7ab

@hellofromtonya hellofromtonya added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Aug 23, 2023
@hellofromtonya hellofromtonya removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Sep 6, 2023
@hellofromtonya
Copy link
Contributor

Removed backport label as Font Face was merged into Core via changeset https://core.trac.wordpress.org/changeset/56500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Typography Font and typography-related issues and PRs [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants