Skip to content

Instantly share code, notes, and snippets.

@djrmom
djrmom / custom-hooks.php
Last active September 10, 2018 21:27 — forked from stegel/custom-hooks.php
Custom Hook for refresh on sort
(function($) {
$('.facetwp-sort')).on('change', 'select', function() {
FWP.refresh();
});
})(jQuery);
@djrmom
djrmom / preselect-current-day.php
Last active January 12, 2018 18:44 — forked from anonymous/preselect-current-day.php
facetwp - Attempt to preload the days events using a specific link
<?php
// Attempt to preload the days events using a specific link
// Link URL should be structured this way http://mercerspace.com/events/?today=true
function fwp_preload_facets( $url_vars ) {
if( 'events' == FWP()->helper->get_uri() && isset( $_GET['today'] ) && empty( $url_vars ) ) {
$url_vars['event_dates'] = array( date( "Y-m-d" ) );
}
return $url_vars;
}