WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

styles_for_block_core_search() WP 1.0

Builds an array of inline styles for the search block.

The result will contain one entry for shared styles such as those for the inner input or button and a second for the inner wrapper should the block be positioning the button "inside".

Хуков нет.

Возвращает

Массив. Style HTML attribute.

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

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

Код styles_for_block_core_search() WP 5.8.1

function styles_for_block_core_search( $attributes ) {
	$shared_styles  = array();
	$wrapper_styles = array();

	// Add width styles.
	$has_width   = ! empty( $attributes['width'] ) && ! empty( $attributes['widthUnit'] );
	$button_only = ! empty( $attributes['buttonPosition'] ) && 'button-only' === $attributes['buttonPosition'];

	if ( $has_width && ! $button_only ) {
		$wrapper_styles[] = sprintf(
			'width: %d%s;',
			esc_attr( $attributes['width'] ),
			esc_attr( $attributes['widthUnit'] )
		);
	}

	// Add border radius styles.
	$has_border_radius = ! empty( $attributes['style']['border']['radius'] );

	if ( $has_border_radius ) {
		// Shared style for button and input radius values.
		$border_radius   = $attributes['style']['border']['radius'];
		$shared_styles[] = sprintf( 'border-radius: %spx;', esc_attr( $border_radius ) );

		// Apply wrapper border radius if button placed inside.
		$button_inside = ! empty( $attributes['buttonPosition'] ) &&
			'button-inside' === $attributes['buttonPosition'];

		if ( $button_inside ) {
			// We adjust the border radius value for the outer wrapper element
			// to make it visually consistent with the radius applied to inner
			// elements.
			$default_padding  = 4;
			$adjusted_radius  = $border_radius + $default_padding;
			$wrapper_styles[] = sprintf( 'border-radius: %dpx;', esc_attr( $adjusted_radius ) );
		}
	}

	return array(
		'shared'  => ! empty( $shared_styles ) ? sprintf( ' style="%s"', implode( ' ', $shared_styles ) ) : '',
		'wrapper' => ! empty( $wrapper_styles ) ? sprintf( ' style="%s"', implode( ' ', $wrapper_styles ) ) : '',
	);
}