• Hi there, the fields “Display Name” and “Nickname” are not automaticly filled in with new registrations.
    When i put the fields in the Form and hide them, i want them to have the default value: first_name and last_name.
    I only can chose one dynamic field (first or last). I tried: [user:first_name] [user:last_name] and [first_name] [last_name]. Do not work.
    Can somebody point me to the right direction? What to fill in in the field default value?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shabti Kaplan

    (@shabti)

    Hello

    For the time being, you can drop this into your functions.php file:

    add_action('acf_frontend/save_user', 'my_acff_save_user', 10, 2);
    function my_acff_save_user( $form, $user_id ) {
    	
    	$user = get_user_by( 'id', $user_id );
        
        wp_update_user( array( 'ID' => $user_id, 'display_name' => $user->first_name . ' ' . $user->last_name ) );
    }

    We will get this functionality built in very soon

    Thread Starter nicole

    (@nhhpoulsen)

    Hello Shabti Kaplan,

    Thanks for your reply and good to know that this will be built in.

    I put the above in a snippet. But the fields Dislpayname and Nickname stay empty.
    I tried having those fields in the form hidden and also tried the form without these fields.

    Any idea what could go wrong?

    I had the same problem. The code above solved it. Thank you very much.

    I used the Code Snippets plugin to add it to my site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘New User Form – Display name and Nickname’ is closed to new replies.