How to limit user registration to a specific set of domains?

You can do it easily by writing a code inside your theme’s functions.php file. here is the code: function is_valid_email_domain($login, $email, $errors ){ $valid_email_domains = array(“gmail.com”,”yahoo.com”);// whitelist email domain lists $valid = false; foreach( $valid_email_domains as $d ){ $d_length = strlen( $d ); $current_email_domain = strtolower( substr( $email, -($d_length), $d_length)); if( $current_email_domain == strtolower($d) ){ … Read more

Placeholder text for registration form

Another simple way to do this without needing to add another script is using PHP’s str_replace function. $args = array( ‘echo’ => false, ); $form = wp_login_form( $args ); //add the placeholders $form = str_replace(‘name=”log”‘, ‘name=”log” placeholder=”Username”‘, $form); $form = str_replace(‘name=”pwd”‘, ‘name=”pwd” placeholder=”Password”‘, $form); echo $form;

How can I be certain that a user has verified their email after registration?

I’ve tried a few different approaches for verifying the user’s email. For now, what I am doing is this: When a user first registers, set the user’s user_metadata ’email_not_verified’ to 1. add_action( ‘user_register’, ‘sc_user_email_not_verified’ ); function sc_user_email_not_verified( $user_id ) { update_user_meta( $user_id, ’email_not_verified’, 1 ); } Then, override the wp_new_user_notification function so that it adds … Read more

How do I create a password reset link?

After much research, I finally turned to examining the WordPress core file wp_login.php hoping that WP would show how they do it in a non-obtuse manner. From the information around line 331 (WP 4.6.1), I put together the following code. <?php global $gw_activate_template; extract( $gw_activate_template->result ); $url = is_multisite() ? get_blogaddress_by_id( (int) $blog_id ) : … Read more

Google Apps login in wordpress

Use the plugin WordPress Social Login: http://wordpress.org/extend/plugins/wordpress-social-login/ Does exactly what you want except the user doesn’t actually have to type in their username and password if they are already logged in to Google Apps – they just click the Google icon and it will log them in to WordPress using Google Apps. And yes, you … Read more

users table – user_name vs. nicename

The nicename is (usually) just a sanitized version of the username. It’s suppose to be ‘nice’ in the sense that it is the ‘nicename’ that is used as a slug, for example: www.yoursite.com/author/my-nice-name/ will take you to the archive of the author with nicename ‘my-nice-name’. The documentation simply describes it as A string that contains … Read more

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