WP_Block_Metadata_Registry::has_metadata( string $file_or_folder ): bool

In this article

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

Parameters

$file_or_folderstringrequired
The path to the file or folder containing the block metadata.

Return

bool True if metadata exists for the block, false otherwise.

Source

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

Changelog

VersionDescription
6.7.0Introduced.

User Contributed Notes

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