wpseek.com
A WordPress-centric search engine for devs and theme authors



get_border_color_classes_for_block_core_search › WordPress Function

Sincen/a
Deprecatedn/a
get_border_color_classes_for_block_core_search ( $attributes )
Parameters:
  • (array) $attributes The block attributes.
    Required: Yes
Returns:
  • (string) The border color classnames to be applied to the block elements.
Defined at:
Codex:

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



Source

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;
}