WP_Theme_JSON::get_element_class_name()public staticWP 6.1.0

Returns a class name by an element name.

Method of the class: WP_Theme_JSON{}

No Hooks.

Return

String. The name of the class.

Usage

$result = WP_Theme_JSON::get_element_class_name( $element );
$element(string) (required)
The name of the element.

Changelog

Since 6.1.0 Introduced.

WP_Theme_JSON::get_element_class_name() code WP 6.1.1

public static function get_element_class_name( $element ) {
	$class_name = '';

	// TODO: Replace array_key_exists() with isset() check once WordPress drops
	// support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
	if ( array_key_exists( $element, static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES ) ) {
		$class_name = static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $element ];
	}

	return $class_name;
}