Custom Fields
Re-Envisioned
Support MB Custom Table Saving user meta in custom table not working Reply To: Saving user meta in custom table not working

#13984

streamlinerr
Participant

custom fields code:

add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
function your_prefix_register_meta_boxes( $meta_boxes ) {
    $meta_boxes[] = array (
        'title' => 'User Data',
        'id' => 'user-data',
        'fields' => array(
            array (
                'id' => 'user_credits',
                'type' => 'number',
                'name' => 'Credits',
            ),
        ),
        'table' => 'prefix_users_data',
        'type' => 'user',
        'storage_type' => 'custom_table',
    );
    return $meta_boxes;
}