Last active
February 3, 2017 08:17
-
-
Save rynaldos-zz/bc3b3a06c89d3a19b5ce4a7473369de4 to your computer and use it in GitHub Desktop.
[WooCommerce] Replace the default (WC) search widget placeholder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'get_product_search_form' , 'woo_custom_product_searchform' ); | |
function woo_custom_product_searchform( $form ) { | |
$form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '"> | |
<div> | |
<label class="screen-reader-text" for="s">' . __( 'Search for:', 'woocommerce' ) . '</label> | |
<input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="' . __( 'Zoek opleidingen', 'woocommerce' ) . '" /> | |
<input type="submit" id="searchsubmit" value="'. esc_attr__( 'Search', 'woocommerce' ) .'" /> | |
<input type="hidden" name="post_type" value="product" /> | |
</div> | |
</form>'; | |
return $form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment