Navigation überspringen

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

This support ticket is created vor 1 Jahr, 7 Monaten. There's a good chance that you are reading advice that it now obsolete.

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.

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Nigel vor 1 Jahr, 7 Monaten.

Author
Artikel
#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

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: 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.)

Das Thema „[Geschlossen] Follow on from "[Closed] Critical error – Toolset view"“ ist für neue Antworten geschlossen.