WP_Theme_JSON::get_block_styles( array $style_nodes, array $setting_nodes ): string

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Converts each style section into a list of rulesets containing the block styles to be appended to the stylesheet.

Description

See glossary at https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax

For each section this creates a new ruleset such as:

block-selector { style-property-one: value; }

Additionally, it’ll also create new rulesets as classes for each preset value such as:

.has-value-color {
  color: value;
}

.has-value-background-color {
  background-color: value;
}

.has-value-font-size {
  font-size: value;
}

.has-value-gradient-background {
  background: value;
}

p.has-value-gradient-background {
  background: value;
}

Parameters

$style_nodesarrayrequired
Nodes with styles.
$setting_nodesarrayrequired
Nodes with settings.

Return

string The new stylesheet.

Source

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

	if ( isset( static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $element ] ) ) {
		$class_name = static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $element ];
	}

	return $class_name;
}

/**
 * Options that settings.appearanceTools enables.
 *
 * @since 6.0.0
 * @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`.
 * @since 6.4.0 Added `background.backgroundImage`.
 * @var array
 */
const APPEARANCE_TOOLS_OPT_INS = array(
	array( 'background', 'backgroundImage' ),
	array( 'border', 'color' ),
	array( 'border', 'radius' ),
	array( 'border', 'style' ),
	array( 'border', 'width' ),
	array( 'color', 'link' ),
	array( 'color', 'heading' ),

Changelog

VersionDescription
5.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.