* This is only overridden as part of a HACK solution to a bug in WP 3.0 not allowing suppression of the duplicate email check. * * What it does: Replaces WP's get_user_by(). If during the user creation process (hackily determined by the plugin's instance) * AND the email has not exceeded the account limit, then return false. wp_insert_user() calls this function simply to check if the * email is already associated with an account. So in that instance, if we know that's where the request is originating and that the * email in question is allowed to have multiple accounts, then trick the check into thinking the email isn't in use so that an error * isn't generated. * * @since 2.6 * (based on version from WP 3.3) * * @param string $email User email * @return string User associated with the email */ if (version_compare($GLOBALS['wp_version'], '3.2.99', '>') && !function_exists('get_user_by')) { c2c_AllowMultipleAccounts::$controls_get_user_by = true; function get_user_by($field, $value) { $obj = c2c_AllowMultipleAccounts::$instance; if ('email' == $field && $obj->during_user_creation && !$obj->has_exceeded_limit($value)) { return false; } $userdata = WP_User::get_data_by($field, $value); if (!$userdata) { return false; } $user = new WP_User(); $user->init($userdata); return $user; } }