wp-includes/class-wp-block-type-registry.php:48Registers a block type.
$namestring|WP_Block_Type$argsarrayoptionalarray()WP_Block_Type|false public function register( $name, $args = array() ) { $block_type = null; if ( $name instanceof WP_Block_Type ) { $block_type = $name; $name = $block_type->name; } if ( ! is_string( $name ) ) { _doing_it_wrong( __METHOD__, /* translators: %s: The received block type name type. */ sprintf( __( 'Block type names must be strings, received %s.' ), gettype( $name ) ), '5.0.0' ); return false; } if ( preg_match( '/[A-Z]+/', $name ) ) { _doing_it_wrong( __METHOD__, /* translators: %s: Block name. */ sprintf( __( 'Block type names must not contain uppercase characters. "%s" was given.' ), esc_html( $name ) ), '5.0.0' ); return false; } $name_matcher = '/^[a-z0-9-]+\/[a-z0-9-]+$/'; if ( ! preg_match( $name_matcher, $name ) ) { _doing_it_wrong( __METHOD__, /* translators: %s: Block name. */ sprintf( __( 'Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type. "%s" was given.' ), esc_html( $name ) ), '5.0.0' ); return false; } if ( $this->is_registered( $name ) ) { _doing_it_wrong( __METHOD__, /* translators: %s: Block name. */ sprintf( __( 'Block type "%s" is already registered.' ), $name ), '5.0.0' ); return false; } if ( ! $block_type ) { $block_type = new WP_Block_Type( $name, $args ); } $this->registered_block_types[ $name ] = $block_type; return $block_type; }Introduced in 5.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-block-type-registry.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.