Skip Navigation

[Closed] Follow on from "[Closed] Critical error – Toolset view"

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 1 year, 4 months ago.

Author
Posts
#2626159

Hi

Sorry for the slow reply, my previous ticket got closed.

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

Thanks.

#2626593

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Matt

Do you have details of what the error actually is?

Your debug.log should give details of the error other than just the line number.

(Christopher shared how to turn on the debug.log if it is not already active in the last thread.)

The topic ‘[Closed] Follow on from "[Closed] Critical error – Toolset view"’ is closed to new replies.