-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Plugin: Guard code from redeclaration errors after WP core merge #39888
Conversation
I opened #39889 to coordinate the backporting tasks. |
To make the review process it's possible to check the diff with all the whitespace changes removed: https://github.com/WordPress/gutenberg/pull/39888/files?diff=unified&w=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ this is great, thank you! The E2E failure seems to be unrelated, I restarted that check.
No I haven't yet, I guess I'm supposed to submit a Core patch that adds the block patterns endpoints? They are currently in the |
Yes, the same issue with tests as in #39904 (comment). Merged PR passed all checks in |
Not yet... I'm still unclear about whether we'll merge this API in 6.0, or not, because there are a few PRs related to the webfonts API from folks, so I'm waiting to see if there is a consensus for them and what will happen 👍 |
It looks like @hellofromtonya started looking into bringing those endpoints to WordPress core in WordPress/wordpress-develop#2488. I see files listed in the description but no code changes so far. I'm sure the
Thank you @aristath, I will keep an eye on the webfonts API 👍🏻 |
What?
Part of #39889.
It is expected to declare functions and classes only when they are missing in WordPress core. As soon as we backport the files updated in this PR to WordPress core, they will work only as a fallback for older versions of WordPress.
Why?
To avoid fatal errors because of redeclared functions and classes.
How?
I followed the guidelines at https://github.com/WordPress/gutenberg/tree/trunk/lib#wrap-functions-and-classes-with--function_exists-and--class_exists.
Testing Instructions
There are unit tests that cover those files and they should continue to pass.
We should also test that webfonts API and block patterns continue to work in the editor.