WP_Duotone::migrate_experimental_duotone_support_flag()public staticWP 6.3.0

Migrates the experimental duotone support flag to the stabilized location.

This moves supports.color.__experimentalDuotone to supports.filter.duotone.

Method of the class: WP_Duotone{}

No Hooks.

Return

Array. Filtered block type settings.

Usage

$result = WP_Duotone::migrate_experimental_duotone_support_flag( $settings, $metadata );
$settings(array) (required)
Current block type settings.
$metadata(array) (required)
Block metadata as read in via block.json.

Changelog

Since 6.3.0 Introduced.

WP_Duotone::migrate_experimental_duotone_support_flag() code WP 6.6.2

public static function migrate_experimental_duotone_support_flag( $settings, $metadata ) {
	$duotone_support = isset( $metadata['supports']['color']['__experimentalDuotone'] )
		? $metadata['supports']['color']['__experimentalDuotone']
		: null;

	if ( ! isset( $settings['supports']['filter']['duotone'] ) && null !== $duotone_support ) {
		_wp_array_set( $settings, array( 'supports', 'filter', 'duotone' ), (bool) $duotone_support );
	}

	return $settings;
}