Username from e-mail

As far as i know there is no hook or filter to provide a custom User name for default registration process, however if you really want to modify it, you can alter the $_POST data. here is the sample code: add_action(‘wp_loaded’, ‘wpse_138736_filter_username’); function wpse_138736_filter_username(){ //your code to extract username from email $_POST[‘user_login’] = ‘test’; } … Read more

admin_post in object oriented plugin

You can build this in to just one class. Obviously change the method names to anything you wish, these are just the ones I use in my plugins. You’ll notice that I’ve also added a couple of sanity checks – one is designed to stop people accessing your plugin page directly (i.e. before the core … Read more