Hello,
I have a problem to get values in a checkbox-list. Already red some articles here and in the documentation (https://docs.metabox.io/fields/checkbox-list/#template-usage)
On the user side, I have this field:
[
'name' => 'Vehicles',
'id' => $prefix . 'vehicles',
'type' => 'text_list',
'options' => [
'VW' => 'Brand',
'Golf' => 'Name',
'Black' => 'Color',
],
'clone' => true,
'sort_clone' => true,
'clone_as_multiple' => true,
'max_clone' => 3,
],
How can I access those user specific values?
Tried it whit:
[
'name' => 'Select Vehicles',
'id' => $prefix . 'selected_vehicles',
'type' => 'select_advanced',
'options' => getVehicles(),
'multiple' => true,
'select_all_none' => true,
],
...
function getVehicles() {
$values = rwmb_meta( 'vehicles', ['object_type' => 'user'], $user->ID );
foreach ( $values as $value ) {
return $value;
}
}
But nothing cames back... 🙁
I'dont have any other ideas. Thanks for supporting me!