Did you check the database for the data?
My guess is that the problem is here:
echo '<input type="checkbox" name="cbn[]" id="'.$option['value'].'"',$checkboxes && in_array($option['value'], $checkboxes) ? ' checked="checked"' : '',' /> ';
should be:
echo '<input type="checkbox" name="cbn[]" id="'.$option['value'].'"'.$checkboxes && in_array($option['value'], $checkboxes) ? ' checked="checked"' : ''.' /> ';
Edit:
You’re confusing poor PHP. Try enclosing the tertiary function in parenthesis.
echo '<input type="checkbox" name="cbn[]" id="' . $option['value'] . '"' . ( $checkboxes && in_array( $option['value'], (array) $checkboxes ) ? ' checked="checked"' : '' ) . ' /> ';
Related Posts:
- Prevent post from being published if custom fields not filled
- Trying to save custom post type from frontend partially working
- front end radio custom taxonomy with custom post type
- WordPress Create Post from front-end
- Confusion regarding Nonce & using it in Custom Columns for Saving Checkbox Value to Post Meta
- Posting to a Custom Post Type from front end – user generated content
- Custom Post Meta from custom metaboxes is randomly being deleted
- Submitting Custom Post Types with custom fields from Front-end form
- Custom Post Type Metadata Not Saving
- What do the numbers mean at the end of add_action(‘save_post’)…?
- Display custom meta on page that has been check in custom post type
- How to prevent meta data from being edited in a post?
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Front-end Image Upload to Custom Meta Box
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Generate slug and meta data if meta field is empty
- How do I set the default admin sort order for a custom post type to a custom column?
- Submit post and upload image from front-end
- Development of a WordPress Search Plugin – Best Practices
- WordPress 4.4+ : How to revision CPT + metadata
- WP_Query orderby custom field then post_date in one query
- Using Custom Fields in Custom Post Type URL
- Query custom post type by custom field
- Adding meta values to permalink
- Filter a custom field based on selection of another custom field (ACF) [closed]
- How to get custom metabox image field?
- Using custom field as custom post title
- List custom post types in dropdown
- Search everything (posts, pages, tags, cpt, meta)
- Custom field being erased after autosave
- How to get source of custom meta image?
- Get post info inside modal window?
- Add Taxonomy Values Within a Custom Post Type RSS Feed
- delete custom post based on custom field date
- Displaying Meta Box Image
- Get_post_meta() won’t return value
- Having trouble with custom date field for CPT query (WordPress)
- How to retrieve custom field types for all posts in WordPress/PHP?
- Custom field default value with counter
- wp parse_query not working with custom meta value
- Related links – from other sites
- 1 day after custom date change post status to draft
- WP_Query that filters based on custom relationship field
- I am having a problem with form updating/editing WordPress post on the frontend
- WP Query—Relationship between two custom post types and their fields
- Why do I lose the content of meta boxes when I leave the page?
- Plugin for custom posts and fields [closed]
- Populate Custom Fields in a Custom Post Type?
- How to change post featured image using a custom field of category?
- Returning a list of custom post types excluding those without a specific meta_value
- How to check if user meta field is empty in conditional else statement
- How to stick custom post at the top in search results
- Custom post type content using custom fields without template
- WP_Query order by custom field, then randomly order some of results
- How to get the upcoming post ID from front end?
- Plugin – Combine Meta Box Input Fields into single saveble record
- Callback to custom field is not working in WordPress REST API
- How to render a custom post type template with custom fields using shortcode
- Get Posts by multiple custom fields is not working
- custom comments form for custom post type
- Custom post type’s extra fields – how to handle?
- Enable Custom Fields For Custom Post Type When CPT Created Using Plugin
- post_per_page ignored in WP_Query
- finding and using post type fields in WordPress
- Sort custom post type by most current date picker
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- Remove default WYSIWYG editor without removing custom fields editors
- Display custom post type for specific user
- Update ACF fields on a frontend form? [closed]
- Filtering Custom Post Type by Comparing Date and Two Meta Keys
- How to keep a record of changes to a custom field?
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Saving metabox keys and storing values as array
- Mandatory field in Custom post
- Update value inside array update_post_meta
- WP query_posts group by meta field related
- WP Query from two Custom Post type fields as statement
- How to upload an image to a custom post type
- when looping through custom post data not appearing
- Where is get_post_meta value located?
- Post meta is not accessible within save_post hook
- Adding a Section for Visitors
- Automatic Set Category For A Custom Post Type
- Confused about where to store my data
- Sort loop by custom field from different post type
- Meta_query by date for Events archive
- Custom meta box data not saving
- WordPress loop, show only one post per custom field
- Custom Post Type as invoice or order template
- WP_Query get posts where post_name is empty
- Make each Value of custom field show related posts when clicked
- Filter CPT based on meta box value using Flexible Posts widget?
- Querying meta values within an array
- Creating entries with image attachements within posts and managing them in a list
- How to Create a Frontend Html-list Editable in the Backend?
- How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
- Filter Custom post type by another Custom post type
- Retrieve a post with its ACF repeater fields in wordpress
- Update Custom Field daily within 7days
- How to use wp_set_object_terms depending on page ID?