get_border_color_classes_for_block_core_search()WP 1.0

Returns border color classnames depending on whether there are named or custom border colors.

Хуков нет.

Возвращает

Строку. The border color classnames to be applied to the block elements.

Использование

get_border_color_classes_for_block_core_search( $attributes );
$attributes(массив) (обязательный)
The block attributes.

Код get_border_color_classes_for_block_core_search() WP 6.0.2

function get_border_color_classes_for_block_core_search( $attributes ) {
	$has_custom_border_color = ! empty( $attributes['style']['border']['color'] );
	$border_color_classes    = ! empty( $attributes['borderColor'] ) ? sprintf( 'has-border-color has-%s-border-color', $attributes['borderColor'] ) : '';
	// If there's a border color style and no `borderColor` text string, we still want to add the generic `has-border-color` class name to the element.
	if ( $has_custom_border_color && empty( $attributes['borderColor'] ) ) {
		$border_color_classes = 'has-border-color';
	}
	return $border_color_classes;
}