Skip to content

Instantly share code, notes, and snippets.

@mgibbs189 mgibbs189/functions.php
Last active Dec 14, 2016

Embed
What would you like to do?
FacetWP - override facet parameters
<?php
function fwp_override_facet_value( $params ) {
foreach ( $params['facets'] as $key => $facet ) {
if ( 'date' == $facet['facet_name'] ) {
$params['facets'][ $key ]['selected_values'] = array( date( 'Y-m-d' ) );
break;
}
}
return $params;
}
add_filter( 'facetwp_render_params', 'fwp_override_facet_value' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.