Site-specific Login plugin

Based on

I developed the „logincustomizing“ Plugin:

Front end registration of a custom field „vtadnr“ (defined via pods)
add_action( 'register_form', 'logincustomizing_registration_form' );
function logincustomizing_registration_form() {

	 if (!empty( $_POST['vtadnr'] )) { $mitgliedsnr = sanitize_text_field($_POST['vtadnr']);} else { $mitgliedsnr =  '';}

	?>
	<p>
		<label for="vtadnr"><?php esc_html_e( 'Mitglieds-Nr.', 'logincustomizing' ) ?><br/>
			<input type="text"		    
			       id="vtadnr"
			       name="vtadnr"
				   maxlength="14"
			       value="<?php echo esc_attr( $mitgliedsnr ); ?>"
			       class="input"
			/>
		</label>
	</p>
	<?php
}
Validate the vtanr field
add_filter( 'registration_errors', 'logincustomizing_registration_errors', 10, 3 );
function logincustomizing_registration_errors( $errors, $sanitized_user_login, $user_email ) {

	if ( empty( $_POST['vtadnr'] ) ) {
		$errors->add( 'vtadnr_error', __( '<strong>Fehler</strong>: Bitte die VTADNR eingeben', 'logincustomizing' ) );
	}
    $pattern = '/*/'; // <----------- customize !!!!
	if ( ! empty( $_POST['vtadnr'] ) && 
	( preg_match($pattern,$_POST['vtadnr']) == 0)) {
		$errors->add( 'vtadnr_error', __( '<strong>Fehler</strong>: Wrong VTADNR', 'logincustomizing' ) );
	}

	return $errors;
}
Save the field
/**
 * Sanitize and save the field, also for backend : edit_user_created_user.
**/
add_action( 'edit_user_created_user', 'logincustomizing_user_register' );
add_action( 'user_register', 'logincustomizing_user_register' );
function logincustomizing_user_register( $user_id ) {
	if ( ! empty( $_POST['vtadnr'] ) ) {
		update_user_meta( $user_id, 'vtadnr', sanitize_text_field($_POST['vtadnr']) );
	}
}
Display the field in the backend (users)
to do!!

logincustomizing