yo siempre uso esta estructura y nunca me ha fallado
Código PHP:
Ver original<?php
add_action('admin_init', 'register_TypePost_fields');
add_action('save_post', 'update_TypePost_fields');
function register_TypePost_fields(){
add_meta_box('ID_fields', 'title fields', 'add_TypePost_fields', 'TypePost', 'normal', 'low');
}
function add_TypePost_fields(){
global $post;
$custom = get_post_custom($post->ID);
if(isset($custom['NameField'])){$NameField = $custom['NameField'][0];} else{$NameField = '';}
?>
<div class="custom_fields">
<label>NameField:</label><br /><input name='NameField' value='<? echo $NameField; ?>' style="width: 100%;" />
</div>
<?php
}
function update_TypePost_fields(){
global $post;
if(isset($_POST['NameField'])){update_post_meta
($post->ID, 'NameField', $_POST['NameField']);} }
?>