PluginProbe
Gutenify – Visual Site Builder Blocks & Starter Templates / trunk
Gutenify – Visual Site Builder Blocks & Starter Templates vtrunk
1.9.0 1.8.0 1.7.0 1.6.6 1.6.5 1.6.4 trunk 0.0.1 0.0.2 0.0.3 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 74 releases
gutenify / core / dist / blocks / advanced-search / render.php

render.php in Gutenify – Visual Site Builder Blocks & Starter Templates trunk, at core/dist/blocks/advanced-search/render.php

23 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /** Advanced Product Search render template. */
3 if ( ! defined( 'ABSPATH' ) ) { exit; }
4 if ( ! class_exists( 'woocommerce' ) ) { return; }
5 $placeholder = isset( $attributes['placeholder'] ) ? sanitize_text_field( $attributes['placeholder'] ) : __( 'Search products…', 'gutenify' );
6 $minimum = isset( $attributes['minimumCharacters'] ) ? max( 1, min( 5, absint( $attributes['minimumCharacters'] ) ) ) : 2;
7 $limit = isset( $attributes['resultLimit'] ) ? max( 1, min( 20, absint( $attributes['resultLimit'] ) ) ) : 6;
8 $delay = isset( $attributes['debounceDelay'] ) ? max( 150, min( 1000, absint( $attributes['debounceDelay'] ) ) ) : 300;
9 $show_categories = ! isset( $attributes['showCategories'] ) || ! empty( $attributes['showCategories'] );
10 $show_view_all = ! isset( $attributes['showViewAll'] ) || ! empty( $attributes['showViewAll'] );
11 $input_id = wp_unique_id( 'ff-product-search-' );
12 $search_url = get_post_type_archive_link( 'product' );
13 ?>
14 <div <?php echo get_block_wrapper_attributes( array( 'class' => 'gutenify--advanced-search', 'data-ff-advanced-search' => '' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> data-rest-url="<?php echo esc_url( rest_url( 'gutenify/v1/products/search' ) ); ?>" data-search-url="<?php echo esc_url( $search_url ); ?>" data-minimum="<?php echo esc_attr( $minimum ); ?>" data-limit="<?php echo esc_attr( $limit ); ?>" data-delay="<?php echo esc_attr( $delay ); ?>" data-show-categories="<?php echo $show_categories ? 'true' : 'false'; ?>" data-show-view-all="<?php echo $show_view_all ? 'true' : 'false'; ?>" data-label-categories="<?php esc_attr_e( 'Categories', 'gutenify' ); ?>" data-label-view-all="<?php esc_attr_e( 'View all results', 'gutenify' ); ?>" data-label-empty="<?php esc_attr_e( 'No products found.', 'gutenify' ); ?>" data-label-searching="<?php esc_attr_e( 'Searching…', 'gutenify' ); ?>" data-label-error="<?php esc_attr_e( 'Search could not be completed.', 'gutenify' ); ?>">
15 <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php esc_html_e( 'Search products', 'gutenify' ); ?></label>
16 <div class="gutenify--advanced-search__field">
17 <input id="<?php echo esc_attr( $input_id ); ?>" type="search" class="gutenify--advanced-search__input" placeholder="<?php echo esc_attr( $placeholder ); ?>" autocomplete="off" role="combobox" aria-autocomplete="list" aria-expanded="false" aria-controls="<?php echo esc_attr( $input_id ); ?>-results">
18 <svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="7" fill="none" stroke="currentColor" stroke-width="2"></circle><path d="m16 16 5 5" fill="none" stroke="currentColor" stroke-width="2"></path></svg>
19 </div>
20 <div id="<?php echo esc_attr( $input_id ); ?>-results" class="gutenify--advanced-search__results" role="listbox" hidden></div>
21 <div class="gutenify--advanced-search__status screen-reader-text" role="status" aria-live="polite"></div>
22 </div>
23