Support Forum » User Profile

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: user_id attribute in mb_user_profile_info shortcode #14462
    streamlinerrstreamlinerr
    Participant

    Yes, I need to let admins edit user profiles.

    in reply to: user_id attribute in mb_user_profile_info shortcode #14446
    streamlinerrstreamlinerr
    Participant

    After some exploration, I noticed that user_id attribute is not listed in shortcode_atts in MB_User_Profile_Shortcode_Info class. If I add 'user_id' => '' to $args array, and modify $meta_box->set_object_id( get_current_user_id() ); to $meta_box->set_object_id( !empty($args['user_id']) ? $args['user_id'] : get_current_user_id() ); I can retrieve data from specified user_id. However, form is still submitted for current_user, not specified user.

    in reply to: Saving user meta in custom table not working #14005
    streamlinerrstreamlinerr
    Participant

    It works now. Thanks!

    in reply to: Saving user meta in custom table not working #13984
    streamlinerrstreamlinerr
    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;
    }
Viewing 4 posts - 1 through 4 (of 4 total)