Automattic\WooCommerce\Admin\Features\ProductBlockEditor
BlockRegistry::remove_block_prefix()
Get the block name without the "woocommerce/" prefix.
Method of the class: BlockRegistry{}
No Hooks.
Returns
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() BlockRegistry::remove block prefix code WC 9.8.5
private function remove_block_prefix( $block_name ) { if ( 0 === strpos( $block_name, 'woocommerce/' ) ) { return substr_replace( $block_name, '', 0, strlen( 'woocommerce/' ) ); } return $block_name; }