FavoriteLoadingAdd to favorites
############################################################################
// Registration Form Custom Fields Configured Here
add_filter( 'rwmb_meta_boxes', 'registration' );
function registration( $meta_boxes ) {
    $meta_boxes[] = [
        'title'  => 'Registration',
        'id'     => 'registration',
        'type'   => 'user',
        'fields' => [],
    ];
    return $meta_boxes;
}
############################################################################
function register_user_profile_fields($meta_boxes) {
    $prefix = 'user_profile_';
    // fields
    $meta_boxes[] = [
        'id'     => $prefix . 'edit_form_basic',
        'title'  => 'Your basic information',
        'type'   => 'user',
        'fields' => [
            [
                'id'   => 'first_name', // THIS
                'name' => 'First Name',
                'type' => 'text',
            ],
            [
                'id'   => 'last_name', // THIS
                'name' => 'Last Name',
                'type' => 'text',
            ],
            [
              'id'       => 'user_email',
              'type'     => 'email',
              'name'     => 'Email address',
              'readonly' => ( wp_get_current_user()->user_email ) ? true : false,
              'required' => true
            ],
            [
              'name' => 'Country Code',
              'id'   => 'mobile_country_code',
              'type' => 'text',
              'required' => true,
            ],
            [
              'name' => 'Contact Number',
              'id'   => 'user_mobile',
              'type' => 'tel',
              'required' => true,
            ],
            [
              'name' => 'Title (Job Role/Position)',
              'id'   => 'user_job_title',
              'type' => 'text',
            ],
        ],
      ];
    return $meta_boxes;
}
add_action( 'rwmb_meta_boxes', 'register_user_profile_fields',2, 1);
############################################################################
//////////////////////////////////////
//  [shortcode_avatar]  //
//////////////////////////////////////
function shortcode_avatar(){
    ob_start();
    include 'avatar.php';
    return ob_get_clean();
}
add_shortcode( 'shortcode_avatar', 'shortcode_avatar');
############################################################################

Pin It on Pinterest

Share This