Created
December 9, 2020 21:02
-
-
Save justlevine/32e5f04a87170361b7a1a7e30343b7ac to your computer and use it in GitHub Desktop.
TEC fukter
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
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