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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.