Uh oh!
There was an error while loading. Please reload this page.
[Backport] Add wp_theme_element_class_name() alias - #3244
Conversation
costdev
left a comment
There was a problem hiding this comment.
Just two minor suggestions 🙂
Uh oh!
There was an error while loading. Please reload this page.
| * | ||
| * @return string The name of the class. | ||
| * | ||
| * @since 6.1.0 |
There was a problem hiding this comment.
Minor: @param and @return should come after @since.
Uh oh!
There was an error while loading. Please reload this page.
| * | ||
| * @return string The name of the class. | ||
| */ | ||
| function wp_theme_element_class_name( $element ) { |
There was a problem hiding this comment.
For consistency with the original method, and for consistent use of the active verb, I'd suggest renaming this alias to wp_theme_get_element_class_name(). 🙂
There was a problem hiding this comment.
Makes sense! That does have a nicer ring to it 😊
ockham
commented
Sep 14, 2022
Since the unit test errors seem spurious (see), I'll try rebasing to kick them off again. |
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
06618d5 to
4c85024Compareaudrasjb
commented
Sep 15, 2022
Committed in https://core.trac.wordpress.org/changeset/54174 @ockham I'll let you close this PR if everything is ok :) |
audrasjb
commented
Sep 15, 2022
Oops, I closed it accidentally :D |
ockham
commented
Sep 15, 2022
No worries @audrasjb 😄 Thank you for committing! |
Add
wp_theme_element_class_name()alias for the "internal"WP_Theme_JSON::get_element_class_name().Backport of @c4rl0sbr4v0s' WordPress/gutenberg#44099.
See this discussion for the rationale.
Note that I've opted not to replace calls to
WP_Theme_JSON::get_element_class_namein the tests -- since those are specifically for theWP_Theme_JSONclass.Trac ticket: https://core.trac.wordpress.org/ticket/56467
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.