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
- SQL query based on two different custom field values
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Max length of meta_value
- Custom field/meta populated by dropdown of existing posts?
- What is the index [0] for on post meta fields?
- Individual Widgets per Page
- Gutenberg add a custom metabox to default blocks
- SQL Query to copy value of a meta_key into another meta_key
- ‘Preview Changes’ for custom meta boxes?
- Using TinyMce with textareas in meta boxes on custom post types
- How to correctly call custom field dates into a posts_where filter using SQL statements
- add meta box – custom field : which to choose?
- Can I query custom meta data through WP_Query
- Add custom fields to search
- Add metabox to document tab in gutenberg
- How to add add_meta_box to specific Page Template?
- How to rename a custom field?
- Custom field metabox not showing in back-end
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- How to hide meta box values from custom fields list?
- Adding another state (spam, reject, approve) to wordpress comments?
- WP doesn’t show Array Custom Fields?
- Arrange custom fields with drag and drop?
- How can I avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
- Unable to get Preview of Uploaded image within a Custom Meta box
- 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?
- Using media-upload.php to upload mp3 via custom fields
- extend Meta Box / Document Panel
- How do I search an array stored in a custom-field using WP_Query?
- Add custom option to Standard Page Attributes Meta Box
- How to store the value of a custom field dropdown select for post referencing?
- get_pages sort alphabetically by meta value
- Add multiple images to a page sidebar
- Only show metabox when date-value in other metabox is over?
- Is it possible to store arrays in a custom field?
- Custom Meta Boxes: Store two values in one repeatable 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?
- Up/Down voting system for WordPress
- Custom Fields Bulk Edit
- How to load php file for specific page in admin?
- How to set default metaboxes on user creation?
- Metabox nonce PHP notice
- TinyMCE in Custom Metabox not loaded after upgrading from WP 3.1.4 to WP 3.2
- 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)
- Problem in custom meta boxes
- Multiplile values checkbox or select in custom meta box
- How to break meta values into different items and avoid duplicates?
- use get_posts to get custom field data, but in one array
- Create custom field key upon theme activation
- 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
- Adding a custom field or metabox to the post-thumbnail widget?
- Custom fields to save multiple values
- How do I add custom_meta_box_id’s value?
- Undefined index error when saving content on metabox
- How to save multiple metaboxes?
- Metabox with multiple fields added by user and upload box
- add meta box using function.php
- Metabox image upload and custom field
- all tincymce’s switch when updating page after changing from html to text in custom metabox
- My metabox class
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- How to construct multiple meta boxes
- Loading scripts to the Post Edit page only
- Force hide custom field metaboxes
- Woocommerce with metabox plugin
- How to sort category by custom field value
- wp_editor removes paragraph from custom meta box
- How to Display Custom Meta Box only on Specific Page IDs
- trim custom field text value and show (…)
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Get all posts that do not have a specific custom field without using a subquery
- Metabox will not save
- Query post order by post and desc not working
- 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
- Passing Custom Field Data as Array to be Saved (Resulting Custom Field Array is inconsistent)
- Where did the Add New Custom Field go?
- Order query by meta_value with multiple custom fields
- How Meta Data is different from Custom Fields of POST/PAGE in WordPress
- Admin meta Image Path
- How to wrap meta values seperated by comma in ? [closed]