WPDev.one
Core Class

WP_Block_Metadata_Registry

class WP_Block_Metadata_Registry // Constructor: function Object() { [native code] }

Class used for managing block metadata collections.

Methods 8 methods

Method / Return Description
register_collection()
bool

Registers a block metadata collection.

Parameters: $path: mixed, $manifest: mixed
get_metadata()
(array

Retrieves block metadata for a given block within a specific collection.

Parameters: $file_or_folder: mixed
get_collection_block_metadata_files()
string[]

Gets the list of absolute paths to all block metadata files that are part of the given collection.

Parameters: $path: mixed
find_collection_path()
(string

Finds the collection path for a given file or folder.

Parameters: $file_or_folder: mixed
has_metadata()
bool

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

Parameters: $file_or_folder: mixed
default_identifier_callback()
string

Default identifier function to determine the block identifier from a given path.

Parameters: $path: mixed
is_valid_collection_path()
bool

Checks whether the given block metadata collection path is valid against the list of collection roots.

Parameters: $path: mixed, $collection_roots: mixed
get_default_collection_roots()
string[]

Gets the default collection root directory paths.

Properties

Property / Type Description
$collections
mixed
public
No description available.
$last_matched_collection
mixed
public
No description available.
$default_collection_roots
mixed
public
No description available.

Class Information

Since Version
6.7.0
Source File
wp-includes/class-wp-block-metadata-registry.php
Advertisement