block_core_social_link_get_color_styles()
Returns CSS styles for icon and icon background colors.
No Hooks.
Returns
String. Inline CSS styles for link's icon and background colors.
Usage
block_core_social_link_get_color_styles( $context );
- $context(array) (required)
- Block context passed to Social Link.
Changelog
| Since 5.7.0 | Introduced. |
block_core_social_link_get_color_styles() block core social link get color styles code WP 6.9.1
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 );
}