Forums

wp_login_form() redirect not working properly (2 posts)

  1. danixland
    Member
    Posted 1 year ago #

    Hello everybody,
    I'm trying to use the wp_login_form() function outside of the wordpress directory of my site. On the page where I need the form to appear I've included the wp-blog-header.php and the login form is appearing correctly, it works like a charm, there's only a small issue with it, it doesn't accept a redirect url different than the url of my wordpress dashboard... I'll explain with an example:
    http://example.net/wordpress is the directory with the WP installation, http://example.net/other is the directory where I've put the page I need the form to appear into. Inside that page I call the wp_login_form() like this:
    <?php wp_login_form('redirect=http://example.net/other/index.php'); ?>
    but this doesn't work and the form, after I correctly login, redirects me to http://example.net/wordpress/wp-admin/... I don't understand why it goes like this.
    I also tried to put the whole array as in the codex explanation page for the function, but it doesn't work either.
    Looking at the resulting html code I see that an hidden input appears with name "redirect_to" and value "http://example.net/other/index.php", but it's kinda useless since the form always returns me to the dashboard.

    How can I work around this small issue??
    Thanks in advance

  2. Frumph
    Member
    Posted 1 year ago #

    http://core.trac.wordpress.org/ticket/15702

    This ticket being addressed to include into 3.1 will help us with doing filters for the wp_login_form to allow specific changes we might want to make like the redirect_to's and such

Topic Closed

This topic has been closed to new replies.

About this Topic