wp_create_block_style_variation_instance_name( array $block, string $variation ): string

In this article

This function has been deprecated. Use wp_unique_id( $variation . ‘–‘ ) instead.

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Generate block style variation instance name.

Parameters

$blockarrayrequired
Block object.
$variationstringrequired
Slug for the block style variation.

Return

string The unique variation name.

Source

function wp_create_block_style_variation_instance_name( $block, $variation ) {
	_deprecated_function( __FUNCTION__, '6.7.0', 'wp_unique_id' );
	return $variation . '--' . md5( serialize( $block ) );
}

Changelog

VersionDescription
6.7.0Use wp_unique_id( $variation . '--' ) instead.
6.6.0Introduced.

User Contributed Notes

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