Changing username after registration to get around the issue of having duplicate emails?

You can try this skeleton plugin: /** * Plugin Name: Allow duplicate emails on registration * Plugin URI: http://wordpress.stackexchange.com/a/125129/26350 */ add_action( ‘plugins_loaded’, array( ‘Allow_Duplicate_Emails_Registration’, ‘get_instance’ ) ); class Allow_Duplicate_Emails_Registration { private $rand = ”; static private $instance = NULL; static public function get_instance() { if ( NULL === self::$instance ) self::$instance = new self; return … Read more

How to override WordPress registration and insert an auto-generated username?

One alternative is to modify the $_POST[‘user_login’] input value when submitting new registration form, that is before WP process the registration form. A good hook to achieve this is login_form_register that fires before processing and rendering registration form. login_init also works but need more work to make sure we are on register action. add_action(‘login_form_register’, ‘custom_user_login’); … Read more

Roles at registration (classipress)

In your functions.php file do this: add_action(‘register_form’,’register_role_field’); add_action(‘register_post’,’check_fields’,10,3); add_action(‘user_register’, ‘register_role_fieldforuser’); // This will register new field in registration form function register_role_field(){ ?> <label>Choose your role:<br/> <!— Let’s check if there role already set. If $_GET[‘role’] = 0 -then this is teacher if 1 = student —> <?php if ( isset( $_GET[‘role’] ) ) { ?> … Read more

Can I hook into the invite user process to verify their email address is from a certain domain?

It is possible to hook into wpmu_validate_user_signup, which returns the $result of the sign-up process. Add another check for the email domain whitelist and add an error if not allowed. add_filter( ‘wpmu_validate_user_signup’, ‘whitelist_registration_wpse_82859’ ); function whitelist_registration_wpse_82859( $result ) { // Test array $whitelist = array( ‘gmail.com’, ‘mydomain.com’ ); // http://php.net/manual/en/function.explode.php $user_name_domain = explode( ‘@’, $result[‘user_email’] … Read more

Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?

I’d figure, it mainly is not advised, because it is intended just to use it for built-in post types, just because you can use for custom post types it does not change anything on that intention. For example, if you use it and there are changes in WordPress that make that arguments use strictly available … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)