Thank you for replay ,
It’s working for me if I remove the condition to check the scope in the argument array. That is I am not able to pass the argument to the function. Is there other way to pass the scope to the function?
I am trying to send the scope using code.
echo EM_Events::output($cell_data['events'],array('format'=>get_option('dbem_full_calendar_event_format'),'scope'=>'last6month'));
code in function.php
add_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions2',1,2);
function my_em_scope_conditions2($conditions, $args){
if( !empty($args['scope']) && $args['scope']=='last6month' ){
$start_date = date('Y-m-d',strtotime("-6 months", current_time('timestamp')));
$end_date = date('Y-m-d',strtotime("last day of last month", current_time('timestamp')));
$conditions['scope'] = "(event_start_date >= CAST('$start_date' AS DATE))";
}
return $conditions;
}
add_filter( 'em_get_scopes','my_em_scopes2',1,1);
function my_em_scopes2($scopes){
$my_scopes = array(
'last6month' => 'last6month'
);
return $scopes + $my_scopes;
}