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.

Built from https://develop.svn.wordpress.org/trunk@54174


git-svn-id: http://core.svn.wordpress.org/trunk@53733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
audrasjb committed Sep 15, 2022
1 parent 81ada51 commit c72fae1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-54173';
$wp_version = '6.1-alpha-54174';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit c72fae1

Please sign in to comment.