Fix code that causes PHP 8.1 deprecation in BlockTypesController (https://github.com/woocommerce/woocommerce-blocks/pull/5287)

This commit is contained in:
Néstor Soriano 2021-12-01 13:58:56 +01:00 committed by GitHub
parent 7e9f8c822d
commit 79722aec00
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ final class BlockTypesController {
*/ */
public function add_data_attributes( $content, $block ) { public function add_data_attributes( $content, $block ) {
$block_name = $block['blockName']; $block_name = $block['blockName'];
$block_namespace = strtok( $block_name, '/' ); $block_namespace = strtok( $block_name ?? '', '/' );
/** /**
* Filters the list of allowed block namespaces. * Filters the list of allowed block namespaces.