Pre-fill the search box if not filled

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Add to your (child) theme’s functions.php

add_filter( ‘facetwp_render_params’, function( $params ) {
foreach ( $params[‘facets’] as $key => $facet ) {
if ( ‘keywords’ == $facet[‘facet_name’] ) { // change “keywords” to your actual facet name
if ( empty( $facet[‘selected_values’] ) ) {
$params[‘facets’][ $key ][‘selected_values’] = ‘circ’;
}
}
}
return $params;
} );
{{/gist}}