WordPress Version: 5.8
/**
* Registers the style and colors block attributes for block types that support it.
*
* @since 5.8.0
* @access private
*
* @param WP_Block_Type $block_type Block Type.
*/
function wp_register_duotone_support($block_type)
{
$has_duotone_support = false;
if (property_exists($block_type, 'supports')) {
$has_duotone_support = _wp_array_get($block_type->supports, array('color', '__experimentalDuotone'), false);
}
if ($has_duotone_support) {
if (!$block_type->attributes) {
$block_type->attributes = array();
}
if (!array_key_exists('style', $block_type->attributes)) {
$block_type->attributes['style'] = array('type' => 'object');
}
}
}