Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren

register_block_type ›

register_block_type ( $name, $args = array() )
Parameter: (2)
  • (string|WP_Block_Type) $name 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.
    Erforderlich: Ja
  • (array) $args { 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 empty array. @type callable $render_callback Callback used to render blocks of this block type. }
    Erforderlich: Nein
    Standard: array()
Gibt zurück:
  • (WP_Block_Type|bool) The registered block type on success, or false on failure.
Definiert in:

Registers a block type.


function register_block_type( $name, $args = array() ) {
	return WP_Block_Type_Registry::get_instance()->register( $name, $args );