-
-
Save robincornett/ed511633189b90ec5734532bd67cc7dc to your computer and use it in GitHub Desktop.
Replace SuperSide Me's default search input with the WooCommerce search.
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
<?php | |
add_filter( 'supersideme_search_output', 'prefix_use_woo_search' ); | |
/** | |
* Replace the default SuperSide Me search form with the WooCommerce product search. | |
* @param $search_form string | |
* | |
* @return string | |
*/ | |
function prefix_use_woo_search( $search_form ) { | |
if ( function_exists( 'get_product_search_form' ) ) { | |
$search_form = '<div class="search-me">'; | |
$search_form .= get_product_search_form( false ); | |
$search_form .= '</div>'; | |
} | |
return $search_form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment