get_border_color_classes_for_block_core_search() – Returns border color classnames depending on whether there are named or custom border colors.

You appear to be a bot. Output may be restricted

Description

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

Usage

$string = get_border_color_classes_for_block_core_search( $attributes );

Parameters

$attributes
( array ) required – The block attributes.

Returns

string The border color classnames to be applied to the block elements.

Source

File name: wordpress/wp-includes/blocks/search.php
Lines:

1 to 9 of 9
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;
}
 

 View on GitHub View on Trac