I have three different posts types registered:
register_post_type( 'foo' , $args );
register_post_type( 'bar' , $args );
register_post_type( 'baz' , $args );
When I am creating a new, say, "foo" post, I only want to save the meta box for "foo", what do I do?
add_action('save_post', 'save_details');
So, if my post_type were called "foo_post":
add_meta_box(
$id,
$title,
$callback,
// SPECIFY THE POST TYPE HERE!!!
"foo_post",
$context,
$priority,
$callback_args );
What do I do to save only "foo post" meta box when I am creating / edit a "foo post" page?
add_meta_boxthen it should only add the meta box for that post type, and if there's no meta box no data will be sent... or have I misunderstood...? :S. In your example 'foo_post' should be just 'foo'. – Stephen Harris Feb 23 '12 at 23:16