Support

Account

Home Forums General Issues Query in URL for ACF chexbox field in CPT Reply To: Query in URL for ACF chexbox field in CPT

  • Yes, if I remove the function below I don’t have any error :

    add_action('pre_get_posts', 'my_pre_get_posts'); 
    function my_pre_get_posts( $query ) {
    
    	$meta_query = $query->get('meta_query');
    	
    	if( isset($_GET['coup_de_coeur']) )
    	{
    		$meta_query[] = array(
    			'key' => 'coup_de_coeur',
    			'value' => $_GET['coup_de_coeur'],
    			'compare' => 'LIKE',
    		);
    	}
    	$query->set('meta_query', $meta_query);
    	return;
    
    }
    

    I checked and it seems like everything is correctly closed, no comma missing…
    Unfortunatelu the critical error doesn’t provide any line of code so I’m a bit in the dark…
    I tried to put WP Debug to true but no luck either.