-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 handler: use wp_get_global_settings
instead of private API
#4980
webfonts handler: use wp_get_global_settings
instead of private API
#4980
Conversation
wp_get_global_settings
instead of private APIwp_get_global_settings
instead of private API
@oandregal all of this code, i.e. I'm wondering:
When will it replaced? |
Yeah, we should. I was planning to do a pass in Gutenberg for the same thing later on.
I believe so. It's a minimal change. Also, in general, temporary code lives much longer than we expect it to do. |
Font feature has been pushed many times. I say merge this small change, it can't hurt it is removed later. |
@hellofromtonya what do you think? I lean towards going ahead with this, given the minimal change and how low impact it is. I am not happy sending even more work towards you! I'm finding it a bit hard to find reviewers that can quickly approve that minimal a change. Though, it is important to me that we use our own APIs the right way. |
I asked the question because committing code that will be removed in the same release cycle seems unnecessary. That said, if for some reason the font management feature planned for 6.4 (the Fonts Library and the code which will replace this temporary stopgap code) does not ship in 6.4, then the changes proposed in this PR can go in. I leave the decision of when to commit this change to you @oandregal, i.e. immediately or wait to see if the font management feature goes into 6.4. As for the change itself, I trust your judgement and expertise on using |
I've prepared a gutenberg PR for this as well WordPress/gutenberg#53805
I'm fine waiting until before the beta, if that's helpful. I added a reminder in my calendar to get back to this in September 18th (later my availability is limited). I still need an approval to merge :) |
The Trac ticket has been closed as |
Trac ticket https://core.trac.wordpress.org/ticket/59028
What
This substitutes the call to a private API
WP_Theme_JSON_Resolver::get_merged_data()->get_settings();
for the public API equivalentwp_get_global_settings()
.Why
We should use our public APIs when possible.
How to test
Verify all tests pass.