intersynergy-login-plugin.php
/**
     * Handles the registration of a new user.
     *
     * Used through the action hook "login_form_register" activated on wp-login.php
     * when accessed through the registration action.
     */
Handles the registration of a new user.
Used through the action hook "login_form_register" activated on wp-login.php
when accessed through the registration action.
Handles the registration of a new user . Used through the action hook " login_form_register " activated on wp - login . php when accessed through the registration action .
public function do_register_user()
    {
        if ('POST' == $_SERVER['REQUEST_METHOD']) {
            $redirect_url = home_url($this->pageSlug['member-register']);
            if (! get_option('users_can_register')) {
                $redirect_url = add_query_arg('register-errors', 'closed', $redirect_url);
            } elseif (! $this->verify_recaptcha()) {
                $redirect_url = add_query_arg('register-errors', 'captcha', $redirect_url);
            } else {
                $email = $_POST['email'];
                $first_name = @sanitize_text_field($_POST['first_name']);
                $last_name = @sanitize_text_field($_POST['last_name']);
                $result = $this->register_user($email, $first_name, $last_name);
                if (is_wp_error($result)) {
                    $errors = implode(',', $result->get_error_codes());
                    $redirect_url = add_query_arg('register-errors', $errors, $redirect_url);
                } else {
                    $redirect_url = home_url($this->pageSlug['member-login']);
                    $redirect_url = add_query_arg('registered', $email, $redirect_url);
                }
            }
            wp_redirect($redirect_url);
            exit;
        }
    }
public function do_register_user ( ) { if ( 'POST' == $ _SERVER [ 'REQUEST_METHOD' ] ) { $ redirect_url = home_url ( $ this -> pageSlug [ 'member-register' ] ) ; if ( ! get_option ( 'users_can_register' ) ) { $ redirect_url = add_query_arg ( 'register-errors' , 'closed' , $ redirect_url ) ; } elseif ( ! $ this -> verify_recaptcha ( ) ) { $ redirect_url = add_query_arg ( 'register-errors' , 'captcha' , $ redirect_url ) ; } else { $ email = $ _POST [ 'email' ] ; $ first_name = @ sanitize_text_field ( $ _POST [ 'first_name' ] ) ; $ last_name = @ sanitize_text_field ( $ _POST [ 'last_name' ] ) ; $ result = $ this -> register_user ( $ email , $ first_name , $ last_name ) ; if ( is_wp_error ( $ result ) ) { $ errors = implode ( ',' , $ result -> get_error_codes ( ) ) ; $ redirect_url = add_query_arg ( 'register-errors' , $ errors , $ redirect_url ) ; } else { $ redirect_url = home_url ( $ this -> pageSlug [ 'member-login' ] ) ; $ redirect_url = add_query_arg ( 'registered' , $ email , $ redirect_url ) ; } } wp_redirect ( $ redirect_url ) ; exit ; } }
Handles the registration of a new user.
Handles the registration of a new user .
// Registration closed, display error // Recaptcha check failed, display error // Parse errors into a string and append as parameter to redirect // Success, redirect to login page.