Checkbox_list only returns one value and not an array of values
-
Hello!
I’m trying to use a checkbox_list at backend but It only returns at frontend one value while I need all the checked values.
My code at frontend is something like that:
<?php
$beach_locations = rwmb_meta(‘easybeach’, $post->ID);
foreach($beach_locations as $beach_location){
echo $beach_location;
};
?>And I get that error: “Warning: Invalid argument supplied for foreach() in /homepages/1/d355829528/htdocs/oceanicrentals/web/wp-content/themes/oceanic/single-rental.php on line 126”
And when I put this code instead:
<?php
$beach_locations = rwmb_meta(‘easybeach’, $post->ID);
echo $beach_locations;
?>I get only one of the values shown. What am I doing wrong?
Thanks in advance!
Antonio
- The topic ‘Checkbox_list only returns one value and not an array of values’ is closed to new replies.