Note: Here is screenshot of code and the image for adding user role to the default WordPress login page.
add_action( 'register_form', 'pookidevs_register_form' );
function pookidevs_register_form() {
global $wp_roles;
echo '<select name="role" class="input">';
foreach ( $wp_roles->roles as $key=>$value ) {
// Exclude default roles such as administrator etc. Add your own
if ( ! in_array( $value['name'] ) ) {
echo '<option value="'.$key.'">'.$value['name'].'</option>';
}
}
echo '</select>'
}
//2. Add validation. In this case, we make sure is required.
add_filter( 'registration_errors', 'pookidevs_registration_errors', 10, 3 );
function pookidevs_registration_errors( $errors, $sanitized_user_login, $user_email ) {
if ( empty( $_POST['role'] ) || ! empty( $_POST['role'] ) && trim( $_POST['role'] ) == '' ) {
$errors->add( 'role_error', __( '<strong>ERROR</strong>: Please add a role to continou.', 'pookidevs' ) );
}
return $errors;
}
//3. Finally, save our extra registration user meta.
add_action( 'user_register', 'pookidevs_user_register' );
function pookidevs_user_register( $user_id ) {
$user_id = wp_update_user( array( 'ID' => $user_id, 'role' => $_POST['role'] ) );
}

Do you want to add a user role selection element to the custom WordPress login page for your website? If you run a WordPress membership site or an online store, then many of your users will often see the login page. Customizing the default WordPress login page allows you to offer a better user experience.
In this article, we will show you how to add a user role selection element to the default login page on your WordPress site.
Here how the default WordPress login screen looks like. You can customize this screen by using the following plugin.

If you want the users to select their role on the login page. WordPress allows you to create a custom user role section element in your Login Page.- and here’s how you can do it.
Step 1: Add a new form element
Let’s create a new form element. Include the following lines of code using Code Snippets. which is an easy, clean and simple way to run PHP code snippets on your site. It removes the need to add custom snippets to your theme’s functions.php file
This code demonstrates how to add a new field to the registration form. Keep in mind that this won’t be saved automatically. You will still need to set up validation rules and manually handle the saving of the additional form fields.
add_action( 'register_form', 'pookidevs_register_form' );
function pookidevs_register_form() {
global $wp_roles;
echo '<select name="role" class="input">';
foreach ( $wp_roles->roles as $key=>$value ) {
// Exclude default roles such as administrator etc. Add your own
if ( ! in_array( $value['name'] ) ) {
echo '<option value="'.$key.'">'.$value['name'].'</option>';
}
}
echo '</select>'
}

Step 2: Add validation
The filtered WP_Error object may, for example, contain errors for an invalid or existing username or email address. A WP_Error object should always be returned, but may or may not contain errors.
If any errors are present in $errors, this will abort the user’s registration.
//2. Add validation. In this case, we make sure is required.
add_filter( 'registration_errors', 'pookidevs_registration_errors', 10, 3 );
function pookidevs_registration_errors( $errors, $sanitized_user_login, $user_email ) {
if ( empty( $_POST['role'] ) || ! empty( $_POST['role'] ) && trim( $_POST['role'] ) == '' ) {
$errors->add( 'role_error', __( 'ERROR: Please add a role to continou.', 'pookidevs' ) );
}
return $errors;
}

Step 3: Finally, save our extra registration user meta.
This action allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as an argument.
Typically, this function is used for saving additional user meta passed by custom registration forms.
//3. Finally, save our extra registration user meta.
add_action( 'user_register', 'pookidevs_user_register' );
function pookidevs_user_register( $user_id ) {
$user_id = wp_update_user( array( 'ID' => $user_id, 'role' => $_POST['role'] ) );
}

Here is what the actual page looks like after adding this code to the snippets.

We hope this article helped you understand WordPress user roles and how to add them to your registration form manually. Feel free to contact us if you need any help regarding this topic.
Do let us know the topics you want us to cover in the comment section or reach out to us with your queries by clicking the contact form below.
Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyway, just wanted to say great blog!
Very nice post. I just stumbled upon your weblog and wished to say that I’ve really enjoyed browsing your blog posts. After all I will be subscribing to your feed and I hope you write again soon!
178435 65271In case you have been injured as a result of a defective IVC Filter, you must contact an experienced attorney practicing in medical malpractice cases, specifically someone with experience in these lawsuits. 644162
Hey there! I’ve been following your blog for a long time now and finally got the bravery to go ahead and give you a shout out from Lubbock Tx!
Just wanted to say keep up the good job!
Hey are using WordPress for your blog platform? I’m new to the blog world but
I’m trying to get started and create my own. Do you need any coding knowledge
to make your own blog? Any help would be greatly appreciated!
I like the valuable info you provide іn yоur articles.
I’ll bookmark your blog and check аgain һere regularly.
Ι’m quite ⅽertain I wiⅼl learn lots ⲟf neԝ
stuff right heгe! Goߋd luck for the next!
Visit mү blog post tangsportbet (Kermit)
Jean, his care for’s younger sister, arrived at the parliament bright and at daybreak on Saturday morning.
“Hi squirt,” she said. Rick didn’t begrudge the attack it was a monicker she had assumed him when he was born. At the tempo, she was six and thought the monicker was cute. They had every time been closer than most nephews and aunts, with a normal miniature piece brainwork function she felt it was her duty to help liberate punctiliousness of him. “Hi Jean,” his mother and he said in unison. “What’s up?” his old lady added.
“Don’t you two think back on, you promised to remedy me support some chattels out to the сторидж drop at Mom and Dad’s farm. Didn’t you attired in b be committed to some too Terri?”
“Oh, I thoroughly forgot, but it doesn’t essentials because of it’s all separated in the underwrite bedroom.” She turned to her son. “Can you serve Rick?”
“Yeah,” He said. “I’ve got nothing planned in support of the day. Tod’s out-moded of hamlet and Jeff is not feeling up to snuff in bed, so there’s no at one to hover discernible with.”
As strong as Rick was, it was smooth a lot of handiwork to pressure the bed, strongbox and boxes from his aunts line and from his own into the pickup. Definitively after two hours they were genial to go. Rick covered the stuff, because it looked like rain and even had to move a pair of the boxes centre the truck locale it on the bum next to Jean.
“You’re effective to participate in to gather on Rick’s lap,” Jean said to Terri, “There won’t be sufficient office otherwise.”
“That when one pleases be alright, won’t it Rick?” his nurturer said.
“Fit as extended as you don’t weigh a ton, and take up the sound side of the business,” he said laughing.
“I’ll enjoy you be familiar with I weigh inseparable hundred and five pounds, unfledged man, and I’m one five foot three, not six foot three.” She was grinning when she said it, but there was a dwarf scrap of pride in her voice. At thirty-six, his matriarch had the cadaver and looks of a elevated coterie senior. Although few extreme devotees girls had 36C boobs that were non-restricted, undeviating and had such flagrant nipples, with the addition of a horde ten ass. Calling his attention to her portion was not the pre-eminent doodad she could be subjected to done.
He settled himself in the tokus and she climbed in and, placing her feet between his, she lowered herself to his lap. She was wearing a scrawny summer clothe and he had seen sole a bikini panty profession and bra beneath it. He immediately felt the fervour from her body whirl into his crotch area. He turned his intellect to the parkway ahead. Jean pulled away, and moments later they were on the motherland road to the farm, twenty miles away.
https://outdoorporn.one/videos/5833/hd-jungle-me-mangal-outdoor-indian-hot-bhabhi-khet-me-chudai/