WP_Theme_JSON::get_block_selectors( object $block_type, string $root_selector ): array
Returns the selectors metadata for a block.
Parameters
-
$block_type
object Required -
The block type.
-
$root_selector
string Required -
The block's root selector.
Return
array The custom selectors set by the block.
Source
File: wp-includes/class-wp-theme-json.php
.
View all references
* @param array $tree Input to process.
* @return array The modified $tree.
*/
private static function resolve_custom_css_format( $tree ) {
$prefix = 'var:';
foreach ( $tree as $key => $data ) {
if ( is_string( $data ) && str_starts_with( $data, $prefix ) ) {
$tree[ $key ] = self::convert_custom_properties( $data );
} elseif ( is_array( $data ) ) {
$tree[ $key ] = self::resolve_custom_css_format( $data );
}
}
return $tree;
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |