wp_user_query with meta_value_num for leaderboard
wp_user_query with meta_value_num for leaderboard
wp_user_query with meta_value_num for leaderboard
How to use same username account for multiple users?
How To Change Username Slug
Username character requirements
Using the regex posted by Moaz (and adding capitals), we will need to hook into the registration_errors filter: // Restrict username registration to alphanumerics add_filter(‘registration_errors’, ‘limit_username_alphanumerics’, 10, 3); function limit_username_alphanumerics ($errors, $name) { if ( ! preg_match(‘/^[A-Za-z0-9]{3,16}$/’, $name) ){ $errors->add( ‘user_name’, __(‘<strong>ERROR</strong>: Username can only contain alphanumerics (A-Z 0-9)’,’CCooper’) ); } return $errors; }
I’m guessing you’ve tried clicking on the “Your post password?” link below the login, and are (for some reason) unable to receive the resulting email. If you have direct access to the database, you can update the password directly: update wp_users set user_pass=md5(‘my_new_password’) where user_name=”my_login”);
Check for alphanumeric For more details, look at the regex Q on SO. $name=”input string 123″; // Doesn”t allow: // Pre-/Appending white space // Not more than one space in between // Non-alphanumeric characters (lower case) if( ! preg_match( “/^[a-z0-9]+([\\s]{1}[a-z0-9]|[a-z0-9])+$/i”, $name ) ) { // Output Error Message } // Or: Does only allow // … Read more
One can find the username of post author in multiple ways. For example, yoursite.com/?author=1 may reveal the username. Even though, it is easy to find the username, it is still not recommended to keep the username for posts. However, it is okay to do so.
According with docs, when you want to retrieve field attached to post using get_field / the_field you should pass a numeric ID as 2nd argument. You are passing a string. So your code should work if: $login = wp_get_current_user()->user_login; $page = $login ? get_page_by_path( $login ) : false; $field = $page ? get_field(‘my_custom_field’, $page->ID) : … Read more
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