I had a similar problem with a custom metabox. The problem was the use of $post_id inside the save-function. Using global $post and then $post->ID solved the problem for me.
function save_metabox(){
global $post;
if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){
return $post->ID;
}
$myData = $_POST['my data'];
update_post_meta($post->ID;, $myData);
}
Related Posts:
- How can I retrieve multiple get_post_meta values efficiently?
- How to batch update post content with custom post meta value
- Using radio button meta data from a custom meta box
- How to I retrieve the ID from the Posts page?
- How to save meta checkbox WordPress
- Updating post meta for checkbox
- How can I tell if a post has been published at least once?
- Adding a meta box to determine the sidebar [closed]
- Simple Custom Metabox Not Saving
- How to add category to: ‘wp-admin/post-new.php’?
- Code to make a post sticky
- How to allow hidden custom fields to be added from wp-admin/post.php?
- Can I force a metabox to be in one column?
- Listen to Post action
- Export WordPress Posts and Meta Information in CSV format
- Delete duplicated wp_postmeta record
- Will a large postmeta table slow a site down?
- upload image in a meta box
- Change slug with custom field
- Better post meta efficiency?
- Edit meta data does’t work with custom sql
- 1 column admin screen options – move submitdiv to bottom
- multicheck box for post metabox
- Human Time Diff, change mins to minutes
- Have save_post write to database image meta [closed]
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- Exporting Data from WordPress into a flat table
- Adding Multiple Values to a Post Meta Key
- PHP Notice error (when on 404 page)
- Checking if a post with certain meta value exists
- How to permanently delete a post meta entry?
- Add custom field automatically (add_post_meta) with value based on number of words of article
- Automatic value for custom fields for posts
- Modify WP_Post before processing
- How to rename “Publish” metabox title in post screen
- Understanding and using metaboxes in posts
- Save re-arranged draggable post items to wordpress database
- I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
- Change post_date to post_modified date on post template?
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- How can I sort posts by the date and a custom meta field?
- is there a way to show the the post title after the image?
- Get Meta Key Value While Saving Post
- Adding custom fields to bbpress reply form
- Force the “Choose from the most used tags” meta box section to always be expanded
- Custom Posts Query and meta_query Sort Order
- Calling Different Custom Post Timestamps in a table
- Simultaneous admin updates causes custom fields to not update
- Is it possible to paste a link without tags and make it directly a link in a post?
- Cannot retrieve a custom RSS field from posts
- Saving custom fields to a custom taxonomy
- Change all author links in Blog roll
- How to calculate the average of a post meta value(Numeric) of a specific author
- Is there any way to tell when wp_postmeta has been updated?
- Get post meta retrieving wrong value
- Change post author without using wp_update_post()
- Show metabox value last post excerpt, title and link
- wp_query with ajax
- Display post number by category
- Automatic blog page with custom design [closed]
- Add multiple meta keys to a post at once
- Show number of posts by logged in user
- How does WP decide how to display a page
- Adding JS functionality to the Publish button in wp-admin/post.php
- When sending a newsletter -not with wordpress- the server has 100% cpu [closed]
- Get post related to particular meta box? [closed]
- Insert data from custom created PHP page into wp_postmeta table
- The loop starting at a certain ID
- saving/reading custom field value does not work – no value gets POSTed
- Display content between two dates?
- Select another post in a post meta like a parent page is selected while editing a page
- SQL DELETE multiple post_meta on single and multi-sites
- Private post caught in endless redirect loop
- Blogposting Schema & Structured Data without plugin
- Automatically select template based on query string for New Posts
- Display Updated Date Instead of Published Date
- How do you update post date (year only) in a separate custom field?
- Add postmeta to all blog posts
- Bulk Post update_post_meta
- WP_Query sort by meta_value_num or date
- Grab meta data before post is saved
- How to fetch posts that are stored in the different table than the default table (wp_posts)?
- Check if user has avatar
- Creating Ordered Query using Meta_key
- Get the correct meta_value with get_post_meta
- Filter question list on substring of metavalue
- Add a meta to a post submited from a frontend form
- Meta boxes not saving
- Edit post meta direct from post.php?
- How to get only current images of a post
- Run function after post is updated
- Adding custom fields to the Quick Edit screen – puzzled about the column concept
- How to separate metabox data in front/backend
- Show related (archive) month and year to post
- How enter custom post meta or custom field on box post list archive page?
- WP_query sort by custom meta_key “price”
- NewsPaper WP Theme – Additional Related Posts Filter by Time (divTag composer)
- What effect can a large wp_post table have on overall site performance?
- Site ‘Categories’: save an admin global setting with post metadata [closed]
- How to make internal links creating plugin to respect ACF?