WP_Duotone::migrate_experimental_duotone_support_flag( array $settings, array $metadata ): array

Migrates the experimental duotone support flag to the stabilized location.

Description

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

Parameters

$settingsarrayrequired
Current block type settings.
$metadataarrayrequired
Block metadata as read in via block.json.

Return

array Filtered block type settings.

Source

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;
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.