My problems

the metadata of the post is not set. I tried looking up the metadata in the wp-postmeta table in the database and it is not there, no matter what I do.

Is there a way to save the metadata even if the post or page is still a draft and the user only hits save draft? If I use the action save_post like I am doing now, I have the impression that it is called only when the post is already published.

Edit

The first problem is solved. I have double-checked the transition hooks that are provided by Wordpress. It seemed to me that the save_post hook should be fired when I edit a post. However what happens is that it is called when I click on the new post button but not when I then save the post as a draft.

To clearify I need a hook that allows me to get a function executed when the user has changed anything on the post to see if my custom checkbox has been changed so I can update the post's metadata accordingly.

To be honest, I do not understand your function. Why would setting the post status to private help me with my problem of updating my post's metadata if you only save a draft or update or publish a post?
–
GorillaPatchMay 4 '11 at 15:06

this is only an example, you can also set an other status, like draft
–
bueltgeMay 8 '11 at 18:33

I think I there is a misunderstanding here: I do not want to change a post's status. What I want is to have a hook available if a new post is created (user clicked on New Post) and a hook when the post is published or saved as a draft to write an option's value to the metadata of the post.
–
GorillaPatchMay 15 '11 at 7:30