Meta Box – Javascript Datatable

Refer to Creating a new PostBox in WordPress. As long as you name the fields the same in render as you do in save then you’re good.

RENDER

echo '<input type="text" id="boxpost_meta_field" name="boxpost_meta_field"';

SAVE

$mydata = sanitize_text_field( $_POST['boxpost_meta_field'] );

// Update the meta field.
update_post_meta( $post_id, '_boxpost_meta_field_value_key', $mydata );

GET

$value = get_post_meta( $post->ID, '_boxpost_meta_field_value_key', true );