wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
register_block_type › WordPress Function
Seit5.0.0
Veraltetn/v
› register_block_type ( $block_type, $args = array() )
| Parameter: (2) |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: | |
| Changelog: |
|
Registers a block type. The recommended way is to register a block type using the metadata stored in the `block.json` file.
Ähnliche Funktionen: unregister_block_type, register_block_style, unregister_block_style, register_block_pattern, register_block_template
Quellcode
function register_block_type( $block_type, $args = array() ) {
if ( is_string( $block_type ) && file_exists( $block_type ) ) {
return register_block_type_from_metadata( $block_type, $args );
}
/** @var (lowercase-string&non-falsy-string)|WP_Block_Type $block_type A string that is not a path to block metadata should be a block type name. */
return WP_Block_Type_Registry::get_instance()->register( $block_type, $args );
}