Automattic\WooCommerce\Admin\Features\ProductBlockEditor

BlockRegistry::remove_block_prefix()privateWC 1.0

Get the block name without the "woocommerce/" prefix.

Method of the class: BlockRegistry{}

No Hooks.

Return

String.

Usage

// private - for code of main (parent) class only
$result = $this->remove_block_prefix( $block_name );
$block_name(string) (required)
Block name.

BlockRegistry::remove_block_prefix() code WC 9.0.1

private function remove_block_prefix( $block_name ) {
	if ( 0 === strpos( $block_name, 'woocommerce/' ) ) {
		return substr_replace( $block_name, '', 0, strlen( 'woocommerce/' ) );
	}

	return $block_name;
}