Support MB User Meta "mb_user_meta & mb_rest_api" has problem Reply To: "mb_user_meta & mb_rest_api" has problem

#13791
Anh TranAnh Tran
Keymaster

Hi Jiro, please change the code for meta boxes to:

add_action( 'rwmb_meta_boxes', 'prefix_register_meta_boxes' );
function prefix_register_meta_boxes( $meta_boxes ) {
    $meta_boxes[] = array(
        'id' => 'personal',
        'title' => 'Personal Information',
        'type' => 'user', // Specifically for user
        'fields' => array(
            array(
                'name'  => 'test mb for user',
                'desc'  => '',
                'id'    => 'test4',
                'type'  => 'text',
            ),
        )
    );
    return $meta_boxes;
}

Your code has 2 issues:

  • The type of the field should not be string, it's text.
  • The function doesn't return $meta_boxes.

I've just made a test with Postman and here is the result:

https://i.imgur.com/F92ilAA.png