I would try using the post ID that’s automatically passed to save_events, rather than the $post global. So:
function save_events( $post_id ){
if ( !wp_verify_nonce( $_POST['events-nonce'], 'events-nonce' )) {
return $post_id;
}
if ( !current_user_can( 'edit_post', $post_id ))
return $post_id;
update_post_meta($post_id, "events_price", $POST['events_price'] );
update_post_meta($post_id, "events_location", $POST['events_location'] );
}
I’m not sure the global $post is reliable here.
If that fails, check that your nonce is being received correctly.
Related Posts:
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- How to force one column layout on custom post type edit page?
- Custom Post Type – Taxonomy Dropdown Menu?
- How to add meta box to backend menu page
- How to add multiple images to a custom post type single post?
- How to add multiple images to custom post type?
- Listing Pages With Checkboxes In a Metabox (and saving them)
- How do I remove all the metaboxes for a custom post type?
- How To Set Custom Post Type Title Without Supports
- Creating a Custom Post Types dropdown in a Meta Box
- Get all posts from custom post type and insert in select input as metabox
- Add pre-existing meta box to new custom post type
- Dynamic page.php template for custom post types
- Add comments meta fields to comments metabox on post edit screen
- WordPress metabox file upload in custom post [duplicate]
- Use Custom Post Type as Custom Field
- Saving multiple Metabox contents
- Display metabox conditionally
- Embed ‘New Post’ Form Inside ‘New Post’ Form
- How to stop wordpress from mangling HTML in a metabox textarea
- Relate two custom post type using meta box
- Hiding Metabox from Screen Options Pull Down
- How to: add option to add more checkboxes on custom post type
- how to set default value for checkbox in wordpress
- Timepicker-addon doesn’t show – Datepicker works fine?
- Metabox Populated with a Custom Post Type – How to Output CPT based on Select?
- Is it possible to create a post using a metabox?
- How can I show/add/save custom metaboxes as an Array of values?
- WordPress custom meta field for custom post not storing data
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- How to Duplicate (multiple meta box)?
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Save an array from drop-down in custom meta box
- Custom meta box not saving
- Push metadata in array
- WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types
- dynamically add a custom field or metabox to custom post type [duplicate]
- Make metabox of custom post type fully autosave- and bulk-/quick-edit compatible
- Custom Post Type uses Custom Tags in add_filter?
- Getting Custom Post Type Meta on Publish
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Adding a metabox on a CPT’s submenu page
- Add additional field to custom post_type
- Save Multiple Metabox values
- Create metaboxes based on custom post type
- How to Echo Metadata Value in Currency Format
- Problem with $post_id object’s property
- How To Display A List Of CPT Posts In A Meta Box On Menus Page?
- populate array with posts
- How to make a meta box?
- Forms and WordPress Nonce
- Why do I have to press the “Update” button twice to save my meta box values?
- Prevent custom post type from showing up in custom menus
- CMB2 metabox create select with list of post from CPT
- Odd behaviour for the update button when displaying a WP_List_Table
- Creating alternate meta box context locations
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Custom meta box in custom post type not working
- WP_Meta_Query object with conditionals
- Query Custom Posts – Add To Selection
- I can’t connect my custom jquery to wp admin
- Saving meta box data?
- Invalid file type when using wp_upload_bits to upload PDF to a custom post type
- Metabox does not show in custom post type
- How to sum values from all custom posts metabox
- One Custom Post Type two different Templates
- Include a metabox in the ‘home’ screen of a custom post type? If not, then the dashboard page?
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?
- Saving a Custom Post Type with a Meta Box results in a “Updating Failed” error
- Adding accordion-section to custom post type edit screen
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- How to get custom post type with dynamic ID
- Create Post Types from a XML url (Real Estate website)
- Custom metabox with image gallery upload that won’t attach images to post
- wp_editor in custom post type is not saving formatted text like bold, italic etc
- Wp Query sort order from custom MetaBox
- Admin metabox with custom post type dropdown option not update choosed input after saving
- Dropdown of existing posts in a metabox
- php output of generated custom metabox
- How to retrieve custom post type permalink in another cpt?
- Meta Box not being added in plugin
- do action inside a class is not working
- How to add a custom meta box below publish box in CPT that is like publish meta box and can contains html?
- Unable to get the values for metaboxes for custom post type
- Problem with ‘save_post’ hook not running
- Edit post meta direct from post.php?
- How to Arrange Support => Thumbnail
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- WPAlchemy Metabox rewriting slug
- Custom metabox value not saving
- Yearly Archive from a custom date metabox (Event Start Date)
- Loading one meta box only on post-new.php with a forward link
- Textarea type on one field custom add_meta_box?
- loop through custom post-type with two meta_keys
- Extending a CPT by Created by another plugin
- Adding a custom “Add Custom Field” button to Custom Meta boxes
- add a “list” into add meta box : problem
- CPT Template Option to Top
- Use a Variable in update_post_meta as the $meta_key