From 9bce8574260b82d9217f50f6999ae951712ae944 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Thu, 15 Sep 2022 10:53:18 +0000 Subject: [PATCH] Editor: Backport `wp_theme_element_class_name()` alias. 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 [https://github.com/WordPress/gutenberg/pull/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 --- src/wp-includes/theme.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index 18afee3abd54d..b8f664d1406cf 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -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. *