“Incorrect verification code” is from a plugin I would think.
What registration plugins are you running?
I disabled all the plugins but still I get the error. Not sure I understand by registration plugins. Below is the list of plugins we have currently installed.
akismet, all in one seo pack, google analytics, hello dolly, jetpack by wordpress.com, jw player 6, more privacy options, multisite administrator tools, nextgen gallery, peter collaboration emails, resend welcome email, sharedaddy, site template, social, subscribe2, themes visibility manager, wordpress importer, wordpress mu domain mapping, wp ui-tabs, accordions and more.
Where are you creating the user? From the wp-admin/network pages?
@sai Siddula, do you have a two step authentication plugin installed?
Thank you all for your replies.
After much digging I found that there was one more plugin installed in the back-end which is not visible in the UI list of plugins. That plugin is adding captcha code to the user registration page. That is working fine if any new person tries to register through blogs website. But the same plugin is causing error even when administrator tries to add through dashboard->add users page.
When I looked in to the code, its adding action and filters. like this –
add_action('init', 'signup_init');
add_action('signup_extra_fields', 'signup_user_captcha_field');
add_filter('wpmu_validate_user_signup', 'signup_user_captcha_filter');
function signup_user_captcha_filter($content)
{
if (!empty($_POST['captcha']))
$_SESSION['entered_captcha'] = $_POST['captcha'] . $content['user_name'];
if(empty($_SESSION['entered_captcha']) || $_SESSION['captcha'] . $content['user_name']!= $_SESSION['entered_captcha'])
$content['errors']->add('captcha', __('Incorrect verification code.'));
return $content;
}
Is it possible to check if the logged in user is Admin and skip this error?
You’ll really want to ONLY call that on the front end registration. So wrap it with this:
if ( !is_admin() ) {
add_action('init', 'signup_init');
add_action('signup_extra_fields', 'signup_user_captcha_field');
add_filter('wpmu_validate_user_signup', 'signup_user_captcha_filter');
}
See http://codex.wordpress.org/Function_Reference/is_admin
Thanks Ipstenu, it worked like a charm!