Skip to content

Instantly share code, notes, and snippets.

@justlevine
Created December 9, 2020 21:02
Show Gist options
  • Save justlevine/32e5f04a87170361b7a1a7e30343b7ac to your computer and use it in GitHub Desktop.
Save justlevine/32e5f04a87170361b7a1a7e30343b7ac to your computer and use it in GitHub Desktop.
TEC fukter
add_filter( 'tribe_events_views_v2_view_repository_args', 'set_default_listview_date', 10, 2 );
/**
* Sets TEC list view date to '30 days ago' when the view is 'now'.
*
* @param array $args The default context args from the filter.
* @param array $context the default TEC context.
*/
function set_default_listview_date( $args, $context ) {
if ( 'now' === $args['ends_after'] ) {
$args['ends_after'] = '30 days ago';
}
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment