The error was here: (Thank you @Rarst)
if ($column_name == 'custom_checkbox_group_sesso') {
$sesso_occupanti = get_post_meta($post_ID, "custom_checkbox_group_sesso", true);
//check that we have a custom field
if ($sesso_occupanti != "")
{
// Separate our comma separated list into an array
$sesso_occupanti = explode(",", $sesso_occupanti);
//loop through our new array
foreach ($sesso_occupanti as $sesso)
{
echo $sesso ;
}
}
};
All I had to do was to delete this sentence:
$sesso_occupanti = explode(",", $sesso_occupanti);
Because, as @Rarst said:
if you are storing array then you get back array as well and don’t
need to explode it.
Related Posts:
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- How to create a Custom Meta Box with Name/Value Admin User Input Fields?
- Run a check for multiple meta key values
- Sort alphabetically by custom field
- query_posts with meta_value
- How to Convert Custom Fields from Text to Array?
- Working with multiple values and metaboxes
- Set class if a meta value is set within post archive
- Saving multiple custom meta box fields
- ‘Preview Changes’ for custom meta boxes?
- Using TinyMce with textareas in meta boxes on custom post types
- add meta box – custom field : which to choose?
- Can I query custom meta data through WP_Query
- Add metabox to document tab in gutenberg
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?
- Add custom option to Standard Page Attributes Meta Box
- Only show metabox when date-value in other metabox is over?
- Is it possible to store arrays in a custom field?
- Assign/update the custom field value for all posts
- Bulk move (or copy) from a custom field to the post content?
- Order by custom field date with ASC order
- Populating meta box with select-list of existing posts, and assigning it to custom post types
- Create meta boxes that don’t show in custom fields
- How To Create a Metabox of HTML Content with Instructions For Editors When Editing a Post or Page?
- Custom Fields Bulk Edit
- wp_editor in add_meta_boxes does not show gallery
- How do I assign this filter to a variable? (Appending php & markup to the_content)
- use get_posts to get custom field data, but in one array
- Problem with adding exta field in metabox in custom post type
- WP_query : meta_key with custom rule for specific value
- Saving an array in a single custom field
- How do I add custom_meta_box_id’s value?
- My metabox class
- How to construct multiple meta boxes
- Loading scripts to the Post Edit page only
- How to Display Custom Meta Box only on Specific Page IDs
- Metabox will not save
- Get specific custom field keys from a post and put into an array
- Save an array from drop-down in custom meta box
- How to check for specific meta box value on front end and output accordingly
- WP Query Returning All Posts
- How to wrap meta values seperated by comma in ? [closed]
- Custom Field Create Bulk via SQL Query
- Create Multiple File Upload Metabox in WordPress
- Users Select inside custom metabox
- Custom Metabox Not Saving
- Filter by custom field (meta_key) using JSON API
- Should custom meta boxes be able to output shortcodes the same as WordPress’ native post editor?
- Unsaved changes in metabox inputs not detected in the block editor
- Get updated meta value after post update or published (custom post type) using hook
- Why is my Custom Meta Box Field Inputs NOT saving?
- custom-meta-box checkboxes from loop won’t save
- I need a “Choose from existing content” popin
- Outputing a metabox textarea and avoid line breaks inside li tags
- shortcode in a custom metabox
- pre_get_posts : only get posts by wp_usermeta value
- Problem with saving large amount of data in postmeta/usermeta
- Move Title and the Content WYSIWYG editor position
- meta_value and meta_key filtering returning no posts [closed]
- IF Custom field value equals ZERO
- How to use media upload on metabox post page without breaking TinyMCE?
- Displaying Meta-Box Data Properly
- Let’s Create Custom Field Template Documentation
- How to add custom filed value after in wp post title
- Can I save post meta programatically without setting metaboxes?
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- If metabox has content display content
- Custom meta boxes not saving
- SQL: Select wordpress posts with given text string and add a custom field to them?
- Get meta field value of all catgories
- How to store meta field values
- Make separate text boxes for separate WordPress Custom Fields
- Custom Field: how to save array of multiple key-values in WordPress
- User query – getting values for custom meta keys/fields
- Making custom meta box required (with error message if not filled in) on Gutenberg
- Using Customizer API vs Custom Meta Box for custom content
- Allow HTML in Custom Metabox area
- Metabox/Custom fields are not saving input data
- Custom field metabox not showing in back-end
- WordPress admin area: select box with 12.000+ options
- How to display selected option from dropdown list in a metabox
- Save, update, get and sanitize post meta as HTML not plain
- Update custom table on metabox POST
- Metabox value for post loop?
- how to modify a field’s size in a metabox : ROWS height, and scroll control?
- Should I store arrays in custom fields or create custom tables?
- Append custom field items to content from plugin
- When post is updated, custom metadata in text area field is overwritten
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- Custom Field: Display only if a specific key is selected outside the loop
- Can i categorise my meta box?
- Custom Metaboxes, multiple post selection
- added a meta box to post however when saving menu while debug on throws a warning
- When editing a post with a custom meta box the values aren’t displaying correctly
- How to get the value of particular get $meta value in wordpress
- Display custom field value into content with hyperlink
- Extract array from custom field
- get Custom field label (select/dropdown) on front end
- Block Editor – Meta values not saved, meta changes to empty array on update