Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created June 21, 2017 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/8f1e30feae874f9092d61b8ae3bf5f74 to your computer and use it in GitHub Desktop.
Save joshfeck/8f1e30feae874f9092d61b8ae3bf5f74 to your computer and use it in GitHub Desktop.
Example that shows how to modify the EE4 calendar's where parameters
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter('FHEE__EED_Espresso_Calendar__get_calendar_events__query_params', 'my_custom_calendar_where_params', 10, 7 );
function my_custom_calendar_where_params( $where_and_order_by ) {
$where_params = reset($where_and_order_by);
$where_params['OR*category'] = array(
'Event.Term_Taxonomy.Term.slug' => array( 'IN', array('red', 'blue', 'yellow', 'orange') ),
);
$where_and_order_by = array( $where_params, 'order_by'=>array( 'DTT_EVT_start'=>'ASC' ) );
return $where_and_order_by;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment