I'm trying to create a custom post type and I've had the same problem that's described here; my custom meta information was properly saved, when saving manually, but got lost as soon as the autosave ajax ran at least once.
So I now use the shown solution to fix this:
function save_stationinfo($post_id) {
if((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || (defined('DOING_AJAX') && DOING_AJAX) || isset($_REQUEST['bulk_edit'])) return;
update_post_meta($post_id, 'station_url', $_POST['station_url']);
update_post_meta($post_id, 'station_subheadline', $_POST['station_subheadline']);
update_post_meta($post_id, 'station_streams', $_POST['station_streams']);
}
But this disables the autosave functionality for all custom metadata. What I actually want is to make my metabox fully compatibly with the autosave, ajax (not sure what the DOING_AJAX mode is for, though) and bulk-edit/quick-edit functionality of Wordpress, so that custom meta fields get automatically saved and I am able to add some of the fields to the quick-/bulk-edit dialog.
Can anyone please help me here, or show me where I can find a tutorial for this? (Removing the if-statement doesn't help here, as it leads me back to my first problem, of course.) Thanks in advance!
