$attrs Resolved attribute values (unused here). * @return array{description: string|null} */ protected function viewData( Product $product, array $attrs ): array { unset( $attrs ); return array( 'description' => $this->richField( $product->description() ), ); } /** * The block is degenerate when the product has no description. * * @param array $data The reduced view data. * @return bool */ protected function viewDataIsEmpty( array $data ): bool { return null === ( $data['description'] ?? null ); } /** * Sample description for an editor preview. * * @param Product $product The resolved product (unused; the copy is fixed). * @param array $attrs Resolved attribute values (unused here). * @return array{description: string} */ protected function sampleViewData( Product $product, array $attrs ): array { unset( $product, $attrs ); return array( 'description' => '

' . esc_html__( 'This is where your full product description appears. Explain what the product does, who it is for, and what a customer gets when they buy it.', 'releasecart' ) . '

' . '

' . esc_html__( 'Write as much detail as you like here: features, requirements, and support terms all read well in this space.', 'releasecart' ) . '

', ); } }