Replies
@ravisharma – what’s your thoughts on this so far, how are you approaching it? I’d love to see some early concepts rather than just releasing the plugin outright. Who knows, someone might have some suggestions.
Hey Brajesh, any news on this?
- Graham Hoffman on August 21, 2017 at 9:27 am in reply to: Ajax Registration with 'Allow Capital Letters In Username' plugin #10367
It’s not multisite, but my plan will be to use Multisite by the end of the year – any chance you could alter it?
Many Thanks,
Graham - Graham Hoffman on August 18, 2017 at 4:55 pm in reply to: Ajax Registration with 'Allow Capital Letters In Username' plugin #10343
- Graham Hoffman on August 17, 2017 at 11:53 pm in reply to: Ajax Registration with 'Allow Capital Letters In Username' plugin #10339
Any luck with this Brajesh? if not ill remove that plugin for now.
- Graham Hoffman on August 16, 2017 at 11:03 pm in reply to: Ajax Registration with 'Allow Capital Letters In Username' plugin #10335
At the same time – is this pointless if I’m using the Ajax Registration?
BuddyPress Auto Activate Autologin Redirect To Profile On Signup
I ask because it says ” The plugin not only registers them but also logs them to the website automatically. This plugin is responsive and works well on mobile devices.”
- This reply was modified 7 years, 3 months ago by Graham Hoffman.
- Graham Hoffman on August 16, 2017 at 11:00 pm in reply to: Does the BuddyDev Dashboard update all plugins? #10332
Would you like me to cross reference all of my current ones to give you a rundown?
That way I’ll check what version I’m running at, along with your latest so you know what isn’t updating properly (and ill test and update them manually for now)
- This reply was modified 7 years, 3 months ago by Graham Hoffman.
- Graham Hoffman on August 16, 2017 at 9:08 pm in reply to: Ajax Registration with 'Allow Capital Letters In Username' plugin #10327
https://www.dropbox.com/s/i6v789lwh5xfz6a/caps%20in%20username.jpg?dl=1
Screenshot shows error
- Graham Hoffman on August 16, 2017 at 8:59 pm in reply to: Ajax Registration with 'Allow Capital Letters In Username' plugin #10324
https://www.dropbox.com/s/83uimvs1cip56vm/allow-capital-letters-in-username.0.3.zip?dl=1
Can’t find the link haha – it’s just something I’ve used for a while. Here’s the PHP code (perhaps this is something you want to support.
———BEGIN PHP CODE———–
<?php
/*
Plugin Name: Allow Capital Letters In Username
Version: 0.3
Plugin URI: http://ru.forums.wordpress.org/topic/3738
Description: Allows to use uppercase latin letters when registering a new user.
Author: Sergey Biryukov
Author URI: http://sergeybiryukov.ru/
Network: true
*/class Allow_Capital_Letters_In_Username {
function __construct() {
remove_filter( ‘sanitize_user’, ‘strtolower’ );add_filter( ‘wpmu_validate_user_signup’, array( $this, ‘wpmu_validate_user_signup’ ) );
add_filter( ‘bp_core_validate_user_signup’, array( $this, ‘bp_core_validate_user_signup’ ) );
}function remove_error( $result, $error_string ) {
if ( empty( $result[‘errors’]->errors[‘user_name’] ) )
return $result;$error_index = array_search( $error_string, $result[‘errors’]->errors[‘user_name’] );
if ( false !== $error_index ) {
unset( $result[‘errors’]->errors[‘user_name’][ $error_index ] );if ( empty( $result[‘errors’]->errors[‘user_name’] ) )
unset( $result[‘errors’]->errors[‘user_name’] );
else
sort( $result[‘errors’]->errors[‘user_name’] );
}return $result;
}function wpmu_validate_user_signup( $result ) {
if ( 0 !== strcasecmp( $result[‘user_name’], $result[‘orig_username’] ) )
return $result;if ( preg_match( ‘/[A-Z]/’, $result[‘user_name’] ) )
$result = $this->remove_error( $result, __( ‘Only lowercase letters (a-z) and numbers are allowed.’ ) );return $result;
}function bp_core_validate_user_signup( $result ) {
$illegal_names = get_site_option( ‘illegal_names’ );if ( ! validate_username( $result[‘user_name’] ) || in_array( $result[‘user_name’], (array) $illegal_names ) )
return $result;if ( preg_match( ‘/[A-Z]/’, $result[‘user_name’] ) ) {
$result = $this->remove_error( $result, __( ‘Only lowercase letters and numbers allowed’, ‘buddypress’ ) );
$result = $this->remove_error( $result, __( ‘Username must be in lowercase characters’, ‘buddypress’ ) );
}return $result;
}
}new Allow_Capital_Letters_In_Username;
?>——————END——————
Brajesh, the 1st case! Good to see it’s already being thought about.