Outil de recherche WordPress pour les développeurs et auteurs de thèmes



register_block_type ›

Depuis5.0.0
Dépréciéen/a
register_block_type ( $name, $args = array() )
Paramètres: (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.
    Requis: Oui
  • (array) $args { Optional. Array of block type arguments. Any arguments may be defined, however the ones described below are supported by default. Default empty array.
    Requis: Non
    Défaut: array()
Retourne:
  • (WP_Block_Type|false) The registered block type on success, or false on failure.
Défini(e) dans:
Codex:

Registers a block type.



Source

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