WP_Theme_JSON::get_block_name_from_metadata_path( array $block_metadata ): string|null

In this article

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

Extracts the block name from the block metadata path.

Parameters

$block_metadataarrayrequired
Block metadata.

Return

string|null The block name or null if not found.

Source

private static function get_block_name_from_metadata_path( $block_metadata ) {
	return $block_metadata['path'][2] ?? null;
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

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