• hi all,
    I am trying to implement user registration redirect,I am using wp registration process on my custom page,
    here is my code for registration form

    <form action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
    <input type="text" name="user_login" value="" id="user_login" class="input" />
    <input type="text" name="user_email" value="" id="user_email" class="input"  />
    <?php do_action('register_form'); ?>
    <input type="submit" value="Register" id="register" />
    <input type="hidden" name="redirect_to" value="<?php bloginfo('url'); ?>"/>
    <p class="statement">A password will be e-mailed to you.</p>
    </form>

    and this function I placed in my function.php

    add_action('registration_redirect','myfunc');
    function myfunc($user_email, $user_login,10,3)
    {
    	if(!($user_email))
    
    	{
    		wp_redirect(get_bloginfo('url'),'?message=1');
    	}
    	else
    	{
    		wp_redirect(get_bloginfo('url'),'?message=2');
    	}
    	exit();
    }

    now on mysite/wp-login.php?action=register page showing errors
    1-Warning: header() expects parameter 3 to be long.
    2-Warning: Missing argument 2 for myfunc() in
    3-Warning: Missing argument 3 for myfunc() in
    can any one help?

The topic ‘registration redirect control’ is closed to new replies.