Hi
Sorry for the slow reply, my previous ticket got closed (https://toolset.com/forums/topic/critical-error-toolset-view/).
It seems to be an issue with the custom code snippet you provided:
`add_filter( 'wpv_filter_query', 'func_custom_date_filter_query', 10, 3);
function func_custom_date_filter_query( $view_args, $view_settings, $view_id ){
if ( 71155 == $view_id ) {
if ( (isset($view_args['meta_query'])) && (!empty($view_args['meta_query'])) ) {
$target_field = "_wpscp_schedule_draft_date"; // change this field slug to your field slug
foreach ($view_args['meta_query'] as $key => $value):
if ($value['key'] == $target_field){
$date_range = explode(",",$value['value']);
$start = date('Y-m-d', $date_range[0]);
$end = date('Y-m-d', $date_range[1]);
$view_args['meta_query'][$key] = array('key' => $target_field,
'value' => array($start,$end),
'type' => 'DATE',
'compare' => 'BETWEEN' );
}
endforeach;
}
}
return $view_args;
}`
Any ideas why this may have suddenly stopped working?
Says fatal error.
/public_html/wp-content/toolset-customizations/toolset-custom-code.php on line 21
I had a look in the debug.log file and the last few lines show this:
#18 /home/629785.cloudwaysapps.com/xucgrdhgth/public_html/wp-includes/template-loader.php(106): include('/home/629785.cl...')
#19 /home/629785.cloudwaysapps.com/xucgrdhgth/public_html/wp-blog-header.php(19): require_once('/home/629785.cl...')
#20 /home/629785.cloudwaysapps.com/xucgrdhgth/public_html/index.php(17): require('/home/629785.cl...')
#21 {main}
thrown in /home/629785.cloudwaysapps.com/xucgrdhgth/public_html/wp-content/toolset-customizations/toolset-custom-code.php on line 21
Thanks.