Uses
Uses | Description |
---|---|
wp-includes/class-wp-block-type-registry.php: WP_Block_Type_Registry::get_instance() | Utility method to retrieve the main instance of the class. |
Registers a block type.
(string|WP_Block_Type) (Required) Block type name including namespace, or alternatively a complete WP_Block_Type instance. In case a WP_Block_Type is provided, the $args parameter will be ignored.
(array) (Optional) Array of block type arguments. Accepts any public property of WP_Block_Type
. Any arguments may be defined, however the ones described below are supported by default.
Default value: array()
(WP_Block_Type|false) The registered block type on success, or false on failure.
File: wp-includes/blocks.php
function register_block_type( $name, $args = array() ) { return WP_Block_Type_Registry::get_instance()->register( $name, $args ); }
Version | Description |
---|---|
5.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/register_block_type