Add hooks to filter theme.json data#3247
Closed
oandregal wants to merge 6 commits intoWordPress:trunkfrom
oandregal:add/hooks-for-theme-json
Closed
Add hooks to filter theme.json data#3247oandregal wants to merge 6 commits intoWordPress:trunkfrom oandregal:add/hooks-for-theme-json
theme.json data#3247oandregal wants to merge 6 commits intoWordPress:trunkfrom
oandregal:add/hooks-for-theme-json
Conversation
This was referenced Sep 14, 2022
Contributor
|
I think this looks good to me, but would be good to have someone else from core to take a look as well 🙂 |
Member
Author
|
perhaps @jorgefilipecosta or @gziolo can help? |
Member
Author
|
Related PR #3261 |
pento
pushed a commit
that referenced
this pull request
Sep 15, 2022
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
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this pull request
Sep 15, 2022
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
github-actions bot
pushed a commit
to gilzow/wordpress-performance
that referenced
this pull request
Sep 15, 2022
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
gziolo
reviewed
Sep 16, 2022
Member
gziolo
left a comment
There was a problem hiding this comment.
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.
Member
Author
|
@gziolo addressed your feedback. |
whereiscodedude
pushed a commit
to whereiscodedude/wpss
that referenced
this pull request
Sep 18, 2022
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
ockham
approved these changes
Sep 20, 2022
Contributor
ockham
left a comment
There was a problem hiding this comment.
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.
Contributor
|
Backported in https://core.trac.wordpress.org/changeset/54251 |
ootwch
pushed a commit
to ootwch/wordpress-develop
that referenced
this pull request
Nov 4, 2022
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsondata. Specifically, it adds the following filters:theme_json_default,theme_json_blocks,theme_json_theme``theme_json_user.