Skip to content

Commit

Permalink
Editor: Backport wp_theme_element_class_name() alias.
Browse files Browse the repository at this point in the history
This changeset backports the `wp_theme_element_class_name()` alias for the "internal" `WP_Theme_JSON::get_element_class_name()` function.

This is a backport of [WordPress/gutenberg#44099 gutenberg/PR44099].

Note: this changeset doesn't replace calls to `WP_Theme_JSON::get_element_class_name` in the tests, since those are specifically for the `WP_Theme_JSON` class.

Props bernhard-reiter, cbravobernal, costdev.
See #56467.


git-svn-id: https://develop.svn.wordpress.org/trunk@54174 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
audrasjb committed Sep 15, 2022
1 parent 7991edb commit d0a7711
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/wp-includes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -4210,6 +4210,21 @@ function wp_is_block_theme() {
return wp_get_theme()->is_block_theme();
}

/**
* Given an element name, returns a class name.
*
* Alias of WP_Theme_JSON::get_element_class_name.
*
* @since 6.1.0
*
* @param string $element The name of the element.
*
* @return string The name of the class.
*/
function wp_theme_get_element_class_name( $element ) {
return WP_Theme_JSON::get_element_class_name( $element );
}

/**
* Adds default theme supports for block themes when the 'setup_theme' action fires.
*
Expand Down

0 comments on commit d0a7711

Please sign in to comment.