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
- Formatting post content to exclude gallery
- Why do I get undefined function export_wp()?
- How to remove the embed_footer?
- Function to show only first instance of shortcode
- Using the child theme functions.php to change the customizer.php on parent theme
- Can’t Update function.php after writing short code
- How to get last updated row or ID in wordpress
- How to create function from code?
- How to use Internationalized human_time_diff() function in Chinese?
- Creating new blog on multisite programatically without hacks?
- Limit number of users a role can create
- srcset and custom field get_post_meta and wp_get_attachment_url
- hide shortcode using hooks
- Adding code using functions.php in child theme
- Extending a custom framework built into WordPress to automatically turn the ‘Search Engine Visibility’ setting ON / OFF, dependant on environment
- Page get parameter doesn’t work with is_single() function
- Filter to wp_list_authors
- Contact Form 7 If Condition
- Add Adsense code between job listings – wp job manager plugin
- How can I change the size of the text in Word Press
- Using depth=n in wp_list_pages
- shorthand syntax for custom fields
- Show admin page, only if function is being used
- Show errormessages on wrong username/password on custom loginform?
- Class parameter in get_avatar args doesn’t get added to output
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- locking content with overlay/pop up ads
- How to use `foreach()` in ajax call
- Function not recognizing page id?
- Conditionally write open graph meta property in header
- Pull random comment from specific post, display on homepage with shortcode
- Using array page name together with page id to deregister script
- Give a function a unique ID
- how to handle multiple forloop?
- Comment turned Invisible