SOLVED!!
There was a separate check for CPT needed for the saving to work. So the conditional code now stands at:
function set_options() {
parent::set_options();
global $pagenow;
if ( isset( $_GET['post_type'] )
&& $_GET['post_type'] == 'session'
&& 'post-new.php' == $pagenow || isset( $_GET['post'] )
&& 'session' == get_post_type( $_GET['post'] )
&& 'post.php' == $pagenow || isset( $_POST['post_ID'] )
&& 'session' == get_post_type( $_POST['post_ID'] )
) {
// do your metabox options thing - same code as above
}}
And now everything works as it should. It was the $_POST['post_ID'] that was needed.
Related Posts:
- How to change default position of WP meta boxes?
- Custom Taxonomy as checkbox or dropdown
- Why won’t my metabox data save?
- echo value from ‘select’ field type into page template using cmb2?
- WP_List_Table Inside Metabox Not Working on Submit
- Add metabox with media uploader in a custom post type [duplicate]
- wp_generate_attachment_metadata gives me an empty array
- Best way to arrange custom post types by Attributes -> Order metabox value?
- Removing Edit Permalink/View “Custom Post Type” areas
- Unable to save custom taxonomy terms in a custom-built metabox
- How to sort CPT by custom meta value (date), and return posts month by month
- Possible to add meta box to edit.php pages?
- changing default comment form arguments [duplicate]
- How can I include meta box content when searching?
- update a post meta from a single table cell TablePress
- How to create a repeatable / reusable divs in the metabox?
- How to customize the Categories meta box to allow only one category?
- wp is not defined error using wp.media to create a custom image uploader
- is_page_template not working as expected
- Displaying custom posts only if custom meta box’s date is not expired
- How can I display my custom metaboxes on a custom post template?
- Custom Post Type with metaboxes (no content) only?
- Unable to show meta box data in frontend
- advanced search forms with 3 input text and that the main problem 3 input text
- Why would this IF statement not work? [closed]
- custom comments on specific post type
- Using My-Meta-Box-Class plugin, how is ‘Date’ value stored?
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Keep display metadata value on backend – Custom Metabox
- Register widget only page is a singular of custom post type
- What is the best way to correlate one-to-many content-type relationships?
- Is there a conditional tag to determine whether the post is _any_ custom post type?
- Is it possible to create relational metabox values in a custom post?
- Changing custom type name hides the posts
- Visual editor issue by having multiple tiny mce editors in a CPT
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- Grouping metadatas into one
- Anon function and add_meta_box
- Show Custom Post Type meta boxes only on Page Edit
- Adding Page Templates to post but it ignored it
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Fixed values for same post translations
- Checking if $_FILE isset for an array of file upload metaboxes
- How can I move (or create another) publish button?
- Wrap meta boxes & data handling for specific post types in classes?
- Sizing textarea field in custom metabox
- Meta Data for Custom Post Type not saving
- Remove “show sharing buttons” metabox Jetpack from custom post type
- Custom Post Meta from custom metaboxes is randomly being deleted
- Custom post-type metabox position
- How to add editable/dynamic values to dropdown of a Custom Post Type Meta Box
- Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
- What do the numbers mean at the end of add_action(‘save_post’)…?
- A meta box (in a custom post type) with two different type of fields
- How can I set a meta value that will then affect other post meta values?
- Unable to display selected post title in frontend from metabox wp_dropdown_pages()
- Custom Meta Box returns no HTML
- Topic won’t save for a custom post type — how to debug?
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Removing numerous Meta boxes from numerous CPTs
- Get custom term meta problem on single post type
- Is it possible to sort metabox teaxtarea values?
- wp_editor for custom post type doesn’t save value
- Save Metabox Custom Field Value
- Redirect to URL if x number of days passed
- Adding an extra parameter [string] to my posts’ permalink?
- CMB select with data from CPT
- Empty meta-box returns publishdate if no value is set?
- List of all posts in one custom post type in the edit screen of another
- Select Venue from dropdown list and reuse stored address information in meta_box
- Custom Meta Box with variable number of fields
- Save Custom Post Value
- How to Grab Anime info using Jikan API and fill the value in Metabox
- create a “add icon” field in taxonomies page
- Getting data from dynamically allocated metaboxes within a custom post
- Multiple useres editing specified content
- $_POST from a Meta Box
- Get meta values from parent post and save in child post
- Using meta boxes as the title of a custom post type
- check_admin_referer not working in custom meta box for custom post type
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Convert Custom Post Data to Javascript Array for Autocomplete
- Generating Custom Post Type list, within admin of another custom post type
- Custom meta box in editor of custom post type not working
- Avoid another meta box in my custom post type
- Meta box not saving
- How can i embbed two different galleries in custom post type
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Diffrent search templates for different post types
- Conditional Tags If Custom Post Parent & Child?
- Select custom post by meta value
- Custom post type in submenu with custom meta box as a title with custom html
- Custom post type – permalink
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- How to query custom post then display sections by meta value
- CPT Metabox with email notification
- Move title “meta box” in post mode
- Conditional statement checking two conditions for CPT and Custom Taxonomy [closed]
- Display div based on Group metabox selection [closed]
- Just the First Metabox what saves the data!