private function register() { $user_data = array('user_login' => $this->username, 'user_email' => $this->params['email'], 'user_pass' => $this->password, 'description' => 'Registered With Mobile'); $insert_user = wpl_users::insert_user($user_data); if (is_wp_error($insert_user)) { $this->built['authentication'] = array('type' => 'register', 'status' => 'false'); } else { $this->built['authentication'] = array('type' => 'register', 'status' => 'true'); } return $this->built; }
private function register() { if (!array_key_exists('email', $this->vars) || trim($this->vars['email']) == '') { $this->error = "ERROR: Registering method need to email address!"; return false; } else { $this->email = $this->vars['email']; } $user_data = array('user_login' => $this->username, 'user_email' => $this->email, 'user_pass' => $this->password, 'description' => 'Registered With IO'); $insert_user = wpl_users::insert_user($user_data); if (is_wp_error($insert_user)) { $this->error = $insert_user->get_error_message(); return false; } else { return $this->success_array; } }