Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
90.00% covered (success)
90.00%
18 / 20
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * Product Search Page block pattern.
4 *
5 * WooCommerce-only: composes `filters-product` / `filter-wc-*` blocks, so the
6 * `wc-` filename prefix keeps `register_patterns()` from loading it on non-Woo
7 * sites. Content mirrors `templates/jetpack-search-overlay-product.html`.
8 *
9 * @package automattic/jetpack-search
10 */
11
12namespace Automattic\Jetpack\Search;
13
14if ( ! defined( 'ABSPATH' ) ) {
15    exit( 0 );
16}
17
18$content = Search_Blocks::pattern_content_from_template( 'jetpack-search-overlay-product.html' );
19if ( '' === $content ) {
20    return;
21}
22
23register_block_pattern(
24    'jetpack-search/wc-product-search-page',
25    array(
26        'title'       => __( 'Product Search Page', 'jetpack-search-pkg' ),
27        'description' => __( 'A full-page product search layout with sidebar filters and a product result grid powered by Jetpack Search.', 'jetpack-search-pkg' ),
28        'categories'  => array( 'jetpack-search' ),
29        'keywords'    => array(
30            __( 'search', 'jetpack-search-pkg' ),
31            __( 'product', 'jetpack-search-pkg' ),
32            __( 'woocommerce', 'jetpack-search-pkg' ),
33            __( 'jetpack search', 'jetpack-search-pkg' ),
34        ),
35        'content'     => $content,
36    )
37);