WP_Block_Metadata_Registry::has_metadatapublic staticWP 6.7.0

Checks if metadata exists for a given block name in a specific collection.

Method of the class: WP_Block_Metadata_Registry{}

No Hooks.

Returns

true|false. True if metadata exists for the block, false otherwise.

Usage

$result = WP_Block_Metadata_Registry::has_metadata( $file_or_folder );
$file_or_folder(string) (required)
The path to the file or folder containing the block metadata.

Changelog

Since 6.7.0 Introduced.

WP_Block_Metadata_Registry::has_metadata() code WP 6.8.1

public static function has_metadata( $file_or_folder ) {
	return null !== self::get_metadata( $file_or_folder );
}