Sorry for the bump, but I’m trying to follow this, and I’m not sure where the category search should be added to the ical.php file.
as per smarru’s blog post, I started with getting the category id:
$uri=$_SERVER['REQUEST_URI'];
$args=explode('/',$uri);
/* Get the category ID */
if($args[1]=='events' && $args[2]=='categories') { $cat_name=$args[3]; $cat_obj=get_term_by('name', $cat_name , 'event-categories'); $cat_id=$cat_obj->term_id; }
But then I’m unsure on how/where to use $cat_id there. Should it be replacing ‘event_id’ here?
if( !empty($_REQUEST['event_id']) ){
$EM_Events = array(new EM_Event($_REQUEST['event_id']));
}else{
$EM_Events = EM_Events::get(apply_filters('em_calendar_template_args',array('limit'=>get_option('dbem_ical_limit'), 'owner'=>false, 'orderby'=>'event_start_date', 'scope' => get_option('dbem_ical_scope') )) );
}
or should ‘category’=>$cat_id go in as part of the ‘get(apply_filters(‘ array? And is it safe to assume that this won’t replace the default, root .ics functionality, right?
Thanks for spelling it out a little more!