I'm trying to add a password form to the WP registration form. See the code below. I was wondering if I need to sanitize this specific user input? (and if so how?)
If I understand it correctly, WP has sanitizion built in for some things, and passwords may be one of them. Is that correct? Will WP sanitize it automatically before adding it to the database?
add_action( 'register_new_user', 'registration_change_pass', 10, 99 );
function registration_change_pass( $user_id ) {
if ( isset( $_POST['user_password'] ) ) {
wp_set_password( $_POST['user_password'], $user_id ); }
}