register_chunk_translations( [ $this->block_name ] ); } /** * Enqueue frontend assets for this block, just in time for rendering. * * @internal This prevents the block script being enqueued on all pages. It is only enqueued as needed. Note that * we intentionally do not pass 'script' to register_block_type. * * @param array $attributes Any attributes that currently are available from the block. * @param string $content The block content. * @param WP_Block $block The block object. */ protected function enqueue_assets( array $attributes, $content, $block ) { parent::enqueue_assets( $attributes, $content, $block ); if ( isset( $attributes['color'] ) ) { wp_add_inline_style( 'wc-blocks-style', ':root{--woocommerce-coming-soon-color: ' . esc_html( $attributes['color'] ) . '}' ); } } /** * Get the frontend script handle for this block type. * * @see $this->register_block_type() * @param string $key Data to get, or default to everything. * @return array|string|null */ protected function get_block_type_script( $key = null ) { return null; } }