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 avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
- 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
- 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)
- Saving an array in a single custom field
- Adding a custom field or metabox to the post-thumbnail widget?
- How do I add custom_meta_box_id’s value?
- My metabox class
- Loading scripts to the Post Edit page only
- Woocommerce with metabox plugin
- How to Display Custom Meta Box only on Specific Page IDs
- trim custom field text value and show (…)
- Get specific custom field keys from a post and put into an array
- How to check for specific meta box value on front end and output accordingly
- WP Query Returning All Posts
- How Meta Data is different from Custom Fields of POST/PAGE in WordPress
- Tweak Meta for Post to work it for Pages also
- Custom Field Create Bulk via SQL Query
- Create Multiple File Upload Metabox in WordPress
- Users Select inside custom metabox
- 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?
- Custom Meta Box (SELECT) Not Saving
- Get updated meta value after post update or published (custom post type) using hook
- Why is my Custom Meta Box Field Inputs NOT saving?
- UPDATE on SELECT results. A SQL query to swap Author with Meta Box value
- 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 can I hide custom field from users used for caching response from external api?
- 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
- show a specific metabox dependent on the page template
- 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
- How can I ‘check’ the “custom fields” box from the Screen Options?
- 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
- Use Metabox to enter Post Title
- Include custom fields into the content of a regular page
- 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