Thought it might help if I showed you what I'm trying, which doesn't seem to be working.
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
global $wpdb;
// Get the current post content and set as the default value for the wysiwyg field.
$default_post_author = '';
$post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT );
if( !$post_id ) {
$post_id = filter_input( INPUT_POST, 'post_ID', FILTER_SANITIZE_NUMBER_INT );
}
if( $post_id ) {
$default_post_author = get_post_field( 'post_author', $post_id );
}
$meta_boxes[] = [ 'title' => 'Enrolment Details',
'post_types' => 'enrolment',
'storage_type' => 'custom_table', // Important
'table' => "{$wpdb->prefix}enrolment_metadata", // Your custom table name
'tabs' => [ 'details' => 'Enrolment Details',
'surveys' => 'Surveys' ],
'tab_style' => 'box',
'fields' => [ [ 'name' => 'User ID',
'id' => 'author', // This is the must!
'type' => 'number',
'std' => $default_post_author,
'tab' => 'details' ], ]
];
return $meta_boxes;
});
// Do not save to post meta.
add_filter( 'rwmb_author_value', '__return_empty_string' );