I found the answer now it was the way i was trying to save it this is what I done in the save function
if( isset( $_POST[ 'ck_sale_item' ] ) ) {
update_post_meta( $post_id, 'ck_sale_item', 'on' );
} else {
update_post_meta( $post_id, 'ck_sale_item', 'off' );
}
Related Posts:
- What is the “Advanced” $context in add_meta_box?
- Change The Title Of a Meta Box
- Creating a metabox to upload multiple images
- Post custom metabox textarea using wp_editor
- Removing Metabox for “Slug” without removing functionality
- Prevent sorting and dragging of specific postbox metabox
- Removing meta boxes: remove-meta_box() or unset()?
- CMB2 metabox conditional logic
- Adding submit or update button to custom metabox?
- How to pass variable via $callback_args for add_meta_box
- Undefined function error when creating Custom Meta Box
- Move excerpt to always be directly below post content in admin
- Removing custom meta box added in parent theme
- Use meta box value in CPT as post title
- Getting the ID of a meta box
- Custom filter for the_content doesn’t work correctly
- Check if meta key value already exists
- Is there a predefined callback function for custom categories?
- Conditional Meta Boxes
- Why is `add_meta_box` not working?
- How to access global $wp_meta_boxes variable on front-end?
- PHP Warning: call_user_func() expects parameter 1 to be a valid callback
- prevent post submission
- custom meta box data not saved
- $post->ID incorrect within meta box
- WordPress media manager multiple selection output
- Why is save_post hook not running?
- Why is variable value emptry in $_POST but available in $_REQUEST?
- Are there any standard HTML markup for metabox?
- Can not pass the value of google pie chart from custom meta box
- Dynamically adding WYSIWYG to metaboxes
- Taxonomy as checkboxes
- Change headline text for post thumbnail meta box
- What are ‘authors’ in WordPress, and is there an author ‘metabox class’ available anywhere?
- how to save multiple checkboxes value in wordpress dynamically
- Custom metabox field help tips popups
- Creating an “admin only” meta box with WPAlchemy. Getting a fatal error on front-end when using current_user_can
- Multiple Meta Boxes in separate files
- Meta box html is not updating after saving
- Getting gutenberg (WordPress 5) to save TInymce data?
- Store multiple textarea data in database from a metabox
- Edit woocommerce product post type
- Is there a way to display metabox in frontend? How?
- Custom Sortable Meta Boxes
- How to hook something before edit_form_title?
- Set default value for radio button in WP Alchemy custom meta box?
- quicktags “link” button doesn’t work, but all other buttons do
- Display Term Metabox Only On Certain Term Edit and Add Pages In Admin
- How to prevent further updates of custom meta when using actions to set one meta based on another
- Stop saving process when metabox is invalid [duplicate]
- Add custom action in post type
- List all sidebars in metabox
- Polylang not translating Metabox fields [closed]
- Have mu-plugin remove meta box ONLY if it isn’t already removed in functions.php
- Global Variable vs Local Variable
- Parse a text area custom meta box and assign as value to existing meta keys
- WordPress global variables?
- I have added a metabox and inside it i added a secondary title and a text editor but if i write anything it does not save it or show it on my page
- Starting with tabbed metabox
- How many meta-query fields support WordPress search at a time?
- Save meta data with post, Without using any plugin [closed]
- Cannot remove meta box added through OOP
- Remove meta box except on category pages
- Adding metaboxes to attachment pages
- WP admin display custom field if another field value is “Female”
- Adding a metabox shortcode “paypal accept payment” in my custom post type back-end
- Save JSON object attributes to custom metabox
- Custom Meta Box calling JS function twice
- get_post_meta giving errors while creating a metabox
- how to Add Meta Box with featured image settings and To Edit Post Screen For Inline Styles (css box)?
- How to determine wether a post gets just created
- Load meta box inside meta box.. is this possible?
- get_post_meta not working on my custom-function page
- Moving a metabox – not obeying context or removing old
- Saving metabox content not working
- semantic ui dropdown for custom metabox
- Save datapicker date into wordpress admin
- How Add a Save Button to Custom Meta Box without Leave/Stay js Dialog?
- Removing Meta Generator
- Custom meta box using OOP way doesn’t save data
- Custom meta box repeated field
- Using Meta Boxes in a Custom Page Template
- Issue with file paths after porting metabox from main theme to child theme
- Error in get post by met_key
- Custom meta box not saving values of radio buttons in WordPress
- Display multiple “save draft button” on a post edit
- Serialization problem after auto-update
- Selecting a dynamic sidebar via metabox in wordpress
- Add additional metafields based on value of select box
- Custom-Metaboxes-and-Fields text_url field prepending http://
- How to show metabox key to custom post?
- Updating post meta and Meta Box plugin
- Related posts and custom meta_box?
- header specific meta box result detect url
- Meta Boxes causing Header errors
- Attaching a metabox to a single post
- Calling Data from Custom Meta Box
- How do I allow Authors and Contributors to use the metabox
- CSS styling not working in a custom metabox
- Metaboxes – why they don’t render php in expected manner?