I optimized your function.
<?php
function dd_hctb_create() {
add_meta_box ('dd_meta', 'Heading Content Text Box', 'dd_hctb_cb', 'page', 'normal', 'high');
} // function dd_hctb_create
add_action('add_meta_boxes', 'dd_hctb_create');
function dd_hctb_cb($post) {
wp_nonce_field(basename(__FILE__), 'dd_mbe_content_nonce');
//retrieve the metadata values if they exist
$value = get_post_meta($post->ID, 'dd_mbe_content', true);
?>
<p>
Write any content in here that you want to appear above the main text.
</p>
<textarea id="dd_mbe_content" name="dd_mbe_content" cols="100%" rows="10"><?php echo wp_kses_post($value); ?></textarea>
<?php
} // function dd_hctb_cb
function dd_hctb_save($id, $post) {
// check the autosave
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return $id;
if (
'page' == $post->post_type
&& current_user_can('edit_page', $id)
&& wp_verify_nonce($_POST['dd_mbe_content_nonce'], basename(__FILE__))
&& isset($_POST['dd_mbe_content'])
) update_post_meta($id, 'dd_mbe_content', strip_tags($_POST['dd_mbe_content']));
} // function dd_hctb_save
add_action('save_post', 'dd_hctb_save', 1, 2);
The problem was that your textarea was given id="dd_mbe_content"
and name="middle"
, which took precedence.