Deprecate/Remove the wp_theme_json_get_style_nodes
filter
#45172
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Type] Code Quality
Issues or PRs that relate to code quality
Part of #45171 (an effort to maintain our codebase in a healthy state)
What
Remove the existing
wp_theme_json_get_style_nodes
filter.Why
The
wp_theme_json_get_style_nodes
filter was introduced #41160 (different name back then) and allows consumers to hook into the implementation of theWP_Theme_JSON::get_style_nodes
method.It allows consumers to filter a private method of a private class, converting into public API something that was private.
Unlike the merge algorithm, how we read and process a
theme.json
is not part of the public API. We should be able to change the implementation if we find a performance bottleneck, for example. That we have at some point in time all the style nodes in one place is a very low-level detail that can change if we modify the parser. By exposing this implementation detail, we are creating the expectation that it won't ever change.How
To be explored via PRs.
The text was updated successfully, but these errors were encountered: