It is very sad to say that, User registration page does not contain First Name and Last Name option. Even though, we can allow, firstname and lastname in #MyAccountDetails but not at Registration Page ?
We know, we can do this by something like, hooks or modifying page-register.php
Why not add in a theme option ? And if you insist me to add as registration-fields, there behaviours are odd. Look screenshot, what they, if I add them by custom-field in registration.
Can anyone give me the hooks or php code help to achieve, so that, I can use that name in email-template.
firstname datebase key is fname and lastname is lname
Hello Hemanta Here is what you can do.In the file page-register.php move this line above the first form-group class [code title=”code”] <?php echo str_replace(“col-md-3″,”col-md-5”,str_replace(“col-md-7″,”col-md-7”,$CORE->CORE_FIELDS())); ?> [/code] That will ensure the custom fields created (First Name and Last Name) move above the default fields Finally in the fields you created (First Name and Last Name) make sure you have set the option ‘User can Edit?’ to ‘no’ this will prevent the fields from duplicating in My Account Details section
Hi, I want the user to able to edit their Name. So, I can’t set them to not editable.
And I should be able to call their name by wordpress wp_get_current_user() function. [code] <?php $current_user = wp_get_current_user(); /** * @example Safe usage: $current_user = wp_get_current_user(); * if ( !($current_user instanceof WP_User) ) * return; */ echo ‘Username: ‘ . $current_user->user_login . ‘<br />’; echo ‘User email: ‘ . $current_user->user_email . ‘<br />’; echo ‘User first name: ‘ . $current_user->user_firstname . ‘<br />’; echo ‘User last name: ‘ . $current_user->user_lastname . ‘<br />’; echo ‘User display name: ‘ . $current_user->display_name . ‘<br />’; echo ‘User ID: ‘ . $current_user->ID . ‘<br />’; ?>[/code]
Above code is from wp-codex. Here we only have user_login and email available right now. I want this field, user_firstname,user_lastname and display_name and users are allowed to edit them.
I really want to add this.
I suggest you hire someone if your not sure how to go about
simply disable the first/last in your members area from the general setup -> my account tab and create your own first/lastname fields under general setup -> registration fields.
I did that, it didn’t shows the First name/last name in the #MyAccountDetails tab.
It shows only the box for first_name and last_name and it is blank. Even though I have entered the firstname and lastname.
And what should be the database name for Firstname and lastname , so that I can include it in the Welcome email ?
One more thing, currently the login section need username and password. I want to make it username/email and password i.e. most of us don’t bother about the username, so we should also have an option to use email in place of username( or anyone of these.)
username and password
username/email and password
or anyone of these.
I think this should not be a much more complicated, few lines to edit.
If I add name through registration field, what should be the db_key so that it shows in the users.php Name option.
Hi Mark, any suggestion on these ?
Anyone there who need this ?
Not really, but thanks for sharing 🙂
But I need this to use First Name and Last Name in Email Newsletter.
Everybody needs this, Hemanta ))
Obviously, creating your own first/last name fields (general setup -> registration fields) doesn’t work.
You enter info in those fields, but the system doesn’t save them.
Start your new website today!