• Is it possible to customize the registration page? Specifically, I need to run a PHP function that

    1. creates a custom post type with the user information (name, email)
    2. auto login to the site with their username and password
    3. redirect the user to a URL after registration (which your plugin already does)

    If this is possible, that would be great!! Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Max K

    (@kaminskym)

    Hi,

    Of course with some php coding.

    Regards, Max

    Plugin Author Max K

    (@kaminskym)

    3. redirect the user to a URL after registration (which your plugin already does)

    Redirect all users to the same page?

    Thread Starter themj

    (@mayurj)

    Redirect all users to the same page?

    Yes.

    Thread Starter themj

    (@mayurj)

    Of course with some php coding.

    If you could be so kind, can you point me in the right direction for your files? ie: Which file and function should I place my own code that runs after successful registration?

    Thanks

    Thread Starter themj

    (@mayurj)

    I’m guessing inside public static function signup() of class-ajax.php?

    If I want automatic login.. then after line 219…

    
    //
    //run some php to create post type here
    //
    // Log In user below
    wp_set_current_user( $userID, $user_login );
    wp_set_auth_cookie( $userID, true, false );
    do_action( 'wp_login', $user_login );
    // 
    
    Plugin Author Max K

    (@kaminskym)

    Hi,

    I have checked the code and if Email verification is off – the user should be auto-logged after registration.

    This code:

    if ( ! LRM_Settings::get()->setting('general/registration/user_must_confirm_email') ) {
      $info = array();
      $info['user_login'] = $user_login;
      $info['user_password'] = $userdata['user_pass'];
      $info['remember'] = true;
      $user_signon = wp_signon( $info );
    }
    Plugin Author Max K

    (@kaminskym)

    For creating post you could use hook:

    do_action(‘lrm/registration_successful’, $user_id);

    add_action(‘lrm/registration_successful’, function($user_id){

    $user = get_user_by( ‘id’, $user_id );
    // Create post
    });

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Customize Registration and hooks’ is closed to new replies.