The code is something like this:
add_filter( 'rwmb_meta_boxes', 'test' );
function test( $meta_boxes ) {
// Get current post ID
$post_id = false;
if ( isset( $_GET['post'] ) ) {
$post_id = intval( $_GET['post'] );
}
elseif ( isset( $_POST['post_ID'] ) ) {
$post_id = intval( $_POST['post_ID'] );
}
if ( get_post_status( $post_id ) != 'publish' ) {
$content = 'Not Published';
} else {
$content = 'Published';
}
$meta_boxes[] = array(
'title' => esc_html__( 'Test', 'test' ),
'post_types' => 'testtype',
'context' => 'side',
'priority' => 'low',
'fields' => array(
array(
'id' => "_test",
'type' => 'custom_html',
'std' => $content,
),
)
);
return $meta_boxes;
}