Home › Forums › General Issues › Checkbox List Displaying as an Array in Search › Reply To: Checkbox List Displaying as an Array in Search
Hi,
Alright. We’ll the problem you have here is that you’re directly calling to the meta value with AJAX search pro and since you are able to select multiple values with the checkbox field those are saved as a serialized array in the DB.
So instead of directly adding it to ajax search pro like you’re doing now you’d need to add it using a filter or something like the author says.
Say he gives you an action hook with which you can add the info your function would probably look something like:
function setup_my_checkboxes(){
$checkboxes = get_field('my_checkbox_list');
if( $checkboxes ){
$checkbox_string = implode(', ', $checkboxes);
echo ' – ' . $checkbox_string;
}
}
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.