-
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
Add hooks to filter theme.json
data
#3247
Conversation
I think this looks good to me, but would be good to have someone else from core to take a look as well 🙂 |
perhaps @jorgefilipecosta or @gziolo can help? |
Related PR #3261 |
This consolidates the name of a filter introduced earlier in the 6.1 cycle, renaming it from `get_style_nodes` to `theme_json_get_style_nodes` as to be more coherent with the other hooks introduced in 6.1 as well. This commit backports the original PR from Gutenberg repository: * [WordPress/gutenberg#44189 #44189 Use prefix 'theme_json_' in hooks related to theme.json] Reference: [#3247 #3247 Add hooks to filter theme.json data]. Follow-up to [54118]. Props oandregal, scruffian, bernhard-reiter. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54183 602fd350-edb4-49c9-b593-d223f7449a82
This consolidates the name of a filter introduced earlier in the 6.1 cycle, renaming it from `get_style_nodes` to `theme_json_get_style_nodes` as to be more coherent with the other hooks introduced in 6.1 as well. This commit backports the original PR from Gutenberg repository: * [WordPress/gutenberg#44189 #44189 Use prefix 'theme_json_' in hooks related to theme.json] Reference: [WordPress/wordpress-develop#3247 #3247 Add hooks to filter theme.json data]. Follow-up to [54118]. Props oandregal, scruffian, bernhard-reiter. See #56467. Built from https://develop.svn.wordpress.org/trunk@54183 git-svn-id: http://core.svn.wordpress.org/trunk@53742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This consolidates the name of a filter introduced earlier in the 6.1 cycle, renaming it from `get_style_nodes` to `theme_json_get_style_nodes` as to be more coherent with the other hooks introduced in 6.1 as well. This commit backports the original PR from Gutenberg repository: * [WordPress/gutenberg#44189 #44189 Use prefix 'theme_json_' in hooks related to theme.json] Reference: [WordPress/wordpress-develop#3247 #3247 Add hooks to filter theme.json data]. Follow-up to [54118]. Props oandregal, scruffian, bernhard-reiter. See #56467. Built from https://develop.svn.wordpress.org/trunk@54183 git-svn-id: https://core.svn.wordpress.org/trunk@53742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
I left some minor notes about the PHPDoc comments.
As a follow-up, we should cover new filters with unit tests to ensure they work correctly and don't regress over time.
@gziolo addressed your feedback. |
This consolidates the name of a filter introduced earlier in the 6.1 cycle, renaming it from `get_style_nodes` to `theme_json_get_style_nodes` as to be more coherent with the other hooks introduced in 6.1 as well. This commit backports the original PR from Gutenberg repository: * [WordPress/gutenberg#44189 #44189 Use prefix 'theme_json_' in hooks related to theme.json] Reference: [WordPress/wordpress-develop#3247 #3247 Add hooks to filter theme.json data]. Follow-up to [54118]. Props oandregal, scruffian, bernhard-reiter. See #56467. Built from https://develop.svn.wordpress.org/trunk@54183
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.
Thank you @oandregal! This LGTM
Would you mind filing a PR to address @gziolo's suggestion?
As a follow-up, we should cover new filters with unit tests to ensure they work correctly and don't regress over time.
Backported in https://core.trac.wordpress.org/changeset/54251 |
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.
LGTM 👍
This consolidates the name of a filter introduced earlier in the 6.1 cycle, renaming it from `get_style_nodes` to `theme_json_get_style_nodes` as to be more coherent with the other hooks introduced in 6.1 as well. This commit backports the original PR from Gutenberg repository: * [WordPress/gutenberg#44189 #44189 Use prefix 'theme_json_' in hooks related to theme.json] Reference: [WordPress#3247 WordPress#3247 Add hooks to filter theme.json data]. Follow-up to [54118]. Props oandregal, scruffian, bernhard-reiter. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54183 602fd350-edb4-49c9-b593-d223f7449a82
Trac ticket: https://core.trac.wordpress.org/ticket/56467
Backports WordPress/gutenberg#44015 WordPress/gutenberg#44109 WordPress/gutenberg#44159
This PR ports the work done in Gutenberg (to be released in 14.1) to add hooks to filter the
theme.json
data. Specifically, it adds the following filters:theme_json_default
,theme_json_blocks
,theme_json_theme``theme_json_user
.