-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update global styles public API #36610
Conversation
Maybe worth mentioning in a separate issue; but do we also want to keep the gutenberg_ prefix at the beginning of the functions? |
All of those should be removed with the build for core. |
Edit: disregard my comment, as this only applies to
gutenberg/tools/webpack/blocks.js Lines 123 to 129 in 80e3447
|
function gutenberg_get_global_settings( $path = array(), $block_name = '', $origin = 'all' ) { | ||
if ( '' !== $block_name ) { | ||
$path = array_merge( array( 'blocks', $block_name ), $path ); | ||
function gutenberg_get_global_settings( $path = array(), $context = array() ) { |
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.
Do we want function_exists checks for core?
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.
We don't need them as the current naming stands, but I discussed this with Miguel and I'm going to check how do we want this public API to operate (see). I'll post as a comment any follow-up PR.
Per our private conversation, this PR looks good in terms of API changes. As for the naming of the function so as to operate across plugin and core, that's another question. The two main opposing methods are:
|
I've leveled up my understanding of how |
The second follow-up I thought we need is introducing short-circuit filters to be able to add new behavior from the plugin #36909 |
We decided against the filters. Rationale at #36909 (comment) |
This simplifies the public API of the newly introduced methods in WordPress 5.9. It's based on feedback received as per #36556 and future improvements (such as having multiple theme.json files).
How to test