Forked from anonymous/preselect-current-day.php
Last active
January 12, 2018 18:44
-
-
Save djrmom/7bc6c6c4c92e0a5fcd352e570e05589f to your computer and use it in GitHub Desktop.
facetwp - Attempt to preload the days events using a specific link
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 | |
// 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; | |
} | |
add_action( 'facetwp_preload_url_vars', 'fwp_preload_facets' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment