• Resolved negru13

    (@negru13)


    Hey guys! Does anyone know how to add placeholders values to the existing account fields like “First name”, “Password” etc.? The values are missing by default..
    I want to style the fields by removing the labels and keeping only the placeholders..

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter negru13

    (@negru13)

    Since no one answered this is all that I’ve managed to achieve, maybe it serves anyone else stuck in this matter:

            add_filter( 'um_first_name_form_edit_field', 'my_form_edit_field', 10, 2 );
            function my_form_edit_field( $output, $mode ) {
            
              $fields = UM()->builtin()->get_specific_fields( 'first_name' );
              foreach ($fields as $key => $value) {
               
                $fields['first_name']['placeholder'] = $fields['first_name']['title'];
                $field_value = get_user_meta(um_user('ID'), $key, true) ? : '';
            
                $output = '<div class="um-field um-field-'.$key.'" data-key="'.$key.'">
                <div class="um-field-label">
                <label for="'.$key.'">'.$fields['first_name']['title'].'</label>
                <div class="um-clear"></div>
                </div>
                <div class="um-field-area">
                <input class="um-form-field valid "
                type="text" name="'.$key.'"
                id="'.$key.'" value="'.$field_value.'"
                placeholder="'.$fields['first_name']['title'].'"
                data-validate="" data-key="'.$key.'">
                </div>
                </div>';
            
                //echo $output;
              }
            
            
              return $output;
            }

    I still need a way to do this for all the fields not only for a specific one like this.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @negru13

    Sorry for the late response.

    That’s how I would modify it but we will be working on new changes to make this modify easily in future releases.

    Please feel free to re-open this thread by changing the topic status to “Not Resolved” so we can get back to you.

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Account fields placeholders missing’ is closed to new replies.