Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile editing nickname as username


  • beat sk
    Participant

    @beatwell

    Hello,

    Is there any function or something for the nickname field to take data from username field and possible to save the profile? I’ve tried everything but I can’t do it.
    I don’t want users to be able to change their name at all times, but only administrators will be able to change it through the dashboard.

    I am editing bbpress form-user-edit.php in my child-theme. But still got only ERROR: Please enter a nickname.

    		<div>
    			<label for="first_name"><?php esc_html_e( 'First Name', 'bbpress' ) ?></label>
    			<input type="text" name="first_name" id="first_name" value="<?php bbp_displayed_user_field( 'first_name', 'edit' ); ?>" class="regular-text" />
    		</div>
    
    		<div>
    			<label for="last_name"><?php esc_html_e( 'Last Name', 'bbpress' ) ?></label>
    			<input type="text" name="last_name" id="last_name" value="<?php bbp_displayed_user_field( 'last_name', 'edit' ); ?>" class="regular-text" />
    		</div>
    
    		<div>
    			<input type="hidden" name="nickname" id="nickname" value="<?php echo esc_attr( $profileuser->user_login ); ?>" disabled="disabled" class="regular-text" />
    		</div>

    Thank you.

    beat

  • You must be logged in to reply to this topic.
Skip to toolbar