Automattic\WooCommerce\Blocks\BlockTypes
ProductTemplate::add_block_type_metadata_settings()
Product Template renders inner blocks manually so we need to skip default rendering routine for its inner blocks
Method of the class: ProductTemplate{}
No Hooks.
Return
Array
.
Usage
$ProductTemplate = new ProductTemplate(); $ProductTemplate->add_block_type_metadata_settings( $settings, $metadata );
- $settings(array) (required)
- Array of determined settings for registering a block type.
- $metadata(array) (required)
- Metadata provided for registering a block type.
ProductTemplate::add_block_type_metadata_settings() ProductTemplate::add block type metadata settings code WC 9.4.2
public function add_block_type_metadata_settings( $settings, $metadata ) { if ( ! empty( $metadata['name'] ) && 'woocommerce/product-template' === $metadata['name'] ) { $settings['skip_inner_blocks'] = true; } return $settings; }