The code below is working nearly flawlessly, however my value for page title on one of my pages keeps coming up empty after a few page refreshes... It sticks for awhile, then it
The WordPress Codex has got an function reference for add_meta_box(), with a great example.
And yes, it uses
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
return $post_id;
and I think you've implemented it the right way.
FYI, the solution posted here http://wordpress.org/support/topic/custom-post-type-information-disappearing worked for me and I think is much more elegant.
Wordpress's auto save system may well be your problem, as I think custom fields are not passed along for auto saves (so your customHeader
and customTitle
post variables will be empty during an auto save).
In your save function you should check if the DOING_AUTOSAVE
constant is set (this seems to be preferable to checking the post action) and return if so. Something like this:
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
See this ticket for more info: http://core.trac.wordpress.org/ticket/10744