This is an easy fix by simply using $_REQUEST instead of $_GET in your hidden field for register_form. More importantly, you should be sanitizing the field before you echo it, otherwise you’re wide open to injection and CSRF:
<?php if ( isset( $_REQUEST['role'] ) ) echo esc_attr( $_REQUEST['role'] ) ?>
Related Posts:
- Adding additional roles on registration
- Allow user select role in wordpress default registration without plugin
- Restrict certain roles registrations by domain
- Add multiple custom fields to the general settings page
- Adding fields to the “Add New User” screen in the dashboard
- How to add first name & last name to default registration form?
- Apply custom role capabilities to administrator (without plugin)
- Roles & capabilities GUI that does not create separate table
- Create new user without password
- How to display error messages using WP_Error class?
- How to override WordPress registration and insert an auto-generated username?
- Restrict user registration to emails on a single domain
- How do I redirect upon login a specific user based on role?
- How to add another user to this remove_menu function?
- Add a new subscriber role using a function
- How to test for Super Admin
- Remove default user registration, login and subscriber profiles
- Custom roles can’t access to wp-admin
- WordPress registration and contact form 7 [closed]
- Custom function for specific user role
- Hide Author.php template from specific user role
- edit role display name and label name without plugins
- How to add custom fields to my custom registration form
- create shortcode to list users with specific meta key value
- Toggle User Roles with button
- How to change or add user role after getting post request data about pay? [closed]
- Display alert on successful user Sign Up
- Execute a ultimate member action when user role is updated
- Change label for registration Fields
- Allowing users to view private posts (pending approval)
- Multisite 404 on pages – rewrite error breaks database
- Registration Hooks don’t appear to be working
- Allow Contributor to edit their own posts after Adm aproval
- Trying to register script in footer
- How to add custom JavaScript in functions?
- How to set default post editor based on role?
- Is there a way to direct unregistered user to registration page when click a link?
- load CSS only for administrators on backend
- The Capability to choose post/page template
- How to add array [closed]
- call wp_insert_user in custom class doesnt work
- Get users with different roles and call function on each of them (user_meta)
- How to setup a popup registeration page in wordpress with function.php
- How can I show different content for different user-levels?
- Custom user role still showing up after deletion, ideas?
- How to load a css file depending on the current role
- Remove check boxes and its label from screen option for custom role
- Unable to login after registration
- Add Change role button for list of user in an event
- How to show only specific category post by user role without plugin and restrict all other cats
- Change user role based on total number of items ordered
- Remove all video attachment, both files and post/postmeta from database?
- delete_user_meta for user in spesific group
- Set display name from nickname with register process
- Change the second role depending on the first
- Changing the register url is not working
- Multisite Admin Roles
- Problem in outputting shortcode
- Problem in shortcode outputting content
- add_role menu pages are not visible
- Mail function not working with user accounts
- Register a widget area when a theme option has been saved?
- Welcome Mails based on user role
- Help finishing script to export WP user data when form submitted
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Would it be possible to disable embeds for specific user roles? If so, how?
- How to make my logged-in user-role shortcode displaying name instead of slug?
- Memorizing syntax
- Extract image from content and set it as the featured image
- Variable scope in WordPress functions.php
- How to enqueue every script in a folder automatically?
- How to prevent deleting of comments when deleting a post
- which is the function that removes accented vowels?
- List repeating share links
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Allow latex in wordpress excerpt
- Pages should have priority when using add_rewrite_rule
- Automatically insert php function into post $the_content
- Create dropdown of users in admin dashboard
- wp_trash_post function to only apply to posts, not pages!
- Adding widget to dashboard with wp_dashboard_setup not working
- Image rotation fails to regenerate custom sized thumbnail
- Register and load scripts
- About cron delete user with meta_key
- What does this code do? (Injected code hacked)
- Dequeue Script Using Functions.php
- Using $WPDB to create simple array to check against user entered value
- Create custom function for hero image
- If is_single in functions.php
- How to conditionally add a widget via a hook in functions.php
- Unescape attribute the_title() on CDATA in RSS feed
- Warning at top of website & top menu gone
- Pass post ID from archive template to functions file
- Competing Login Redirects – Need to be Combined?
- How to add styles in existing function?
- Registration form not registering First and Last name
- shortcode inside post called by ID does not render as expected
- Adding and updating repeating custom field meta data
- wp_script_add_data not working
- Help with adding fullcalendar.io to a WordPress page