block_core_social_link_get_color_styles()WP 1.0

Returns CSS styles for icon and icon background colors.

Хуков нет.

Возвращает

Строку. Inline CSS styles for link's icon and background colors.

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

block_core_social_link_get_color_styles( $context );
$context(массив) (обязательный)
Block context passed to Social Link.

Код block_core_social_link_get_color_styles() WP 6.5.2

function block_core_social_link_get_color_styles( $context ) {
	$styles = array();

	if ( array_key_exists( 'iconColorValue', $context ) ) {
		$styles[] = 'color: ' . $context['iconColorValue'] . '; ';
	}

	if ( array_key_exists( 'iconBackgroundColorValue', $context ) ) {
		$styles[] = 'background-color: ' . $context['iconBackgroundColorValue'] . '; ';
	}

	return implode( '', $styles );
}