Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_product_search_form( $echo = true ) {
- do_action( 'get_product_search_form' );
- $search_form_template = locate_template( 'product-searchform.php' );
- if ( '' != $search_form_template ) {
- require $search_form_template;
- return;
- }
- $form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '">
- <div>
- <label class="screen-reader-text" for="s">' . __( '', 'woocommerce' ) . '</label>
- <input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="' . __( '', 'woocommerce' ) . '" />
- <input type="submit" id="searchsubmit" value="'. esc_attr__( 'Search' ) .'" />
- <input type="hidden" name="post_type" value="product" />
- </div>
- </form>';
- if ( $echo )
- echo apply_filters( 'get_product_search_form', $form );
- else
- return apply_filters( 'get_product_search_form', $form );
- }
Advertisement
Add Comment
Please, Sign In to add comment