log-in redirect... WHAT?

Im trying to use the login and out redirect plugin, (2).

The directions at install.txt is as follows...
Plugin Name: Login Redirect
Author: Andrew Billits

Files:
----------------------------------------------------------------------
login-redirect.php - goes in /wp-content/mu-plugins

Instructions:
----------------------------------------------------------------------
1) Place the files in the specified directories
2) Edit the config section at the top of login-redirect.php

So i go to login-redirect and it looks like...

*/

//------------------------------------------------------------------------//
//---Config---------------------------------------------------------------//
//------------------------------------------------------------------------//

$login_redirect_url = 'http://domain.tld'; // the url you want users to be redirected too after logging in

//------------------------------------------------------------------------//
//---Hook-----------------------------------------------------------------//
//------------------------------------------------------------------------//
add_action('login_head', 'login_redirect_to', 1);
add_filter('wp_redirect', 'login_redirect');
//------------------------------------------------------------------------//
//---Functions------------------------------------------------------------//
//------------------------------------------------------------------------//

function login_redirect($location){
global $login_redirect_url;
if ( $location == 'login-redirect' ) {
$location = $login_redirect_url;
}
return $location;
}

If i was using regular wp, i'd just type in the url. But how do i set it so that individual users checking into their OWN blogs automatically end up at their POST page?

Plus, how do i create a "login-log out" site-admin button on themes without them?

Or is instructing users to add a widget my best option.

AND, (sorry about this) is their a widget that won't under-mine my attempts to REbrand site, by offering links to wp?

Thanks guys in advance as usual.

  • lesters
    • Flash Drive

    i tried using your advise, (thenks by the way) but everytime i try to log-in from a test blog it redirects me back to the signup form

    It keeps repeating the login address.

    E.g. mysite.mysite.com/login.php/ login.php/login.php and so forth.

    Can i build this code to log-in into a gif pic or something? so that every blog created already has a link to log into "their own blog" and once logged in the same link to their admin panel?

  • lesters
    • Flash Drive

    I ve been away a couple days Aaron, sorry. Yeah i killed the plug-in before i left.

    I still have it compressed inside my cpanel.

    Lets say i use this code...

    $login_redirect_url = admin_url('widget.php');

    To put here...

    $login_redirect_url = 'http://domain.tld'; // the url you want users to be redirected too after logging in.

    The code should look this way, right?

    $login_redirect_url = admin_url('widget.php');

    //------------------------------------------------------------------------//
    //---Hook-----------------------------------------------------------------//
    //------------------------------------------------------------------------//
    add_action('login_head', 'login_redirect_to', 1);
    add_filter('wp_redirect', 'login_redirect');
    //------------------------------------------------------------------------//
    //---Functions------------------------------------------------------------//
    //------------------------------------------------------------------------//

    function login_redirect($location){
    global $login_redirect_url;
    if ( $location == 'login-redirect' ) {
    $location = $login_redirect_url;
    }
    return $location;
    }

    ........

  • lesters
    • Flash Drive

    "That would be correct if admin_url() tosses out a full url and not just the path".

    Thanks for responding so quickly Aaron, as usual.
    The plugin must work from this assumption, right? because this is for an mu installation. Users sign up simultaneously and create different paths.

    Or is there some more codeing to be done?

    The plugin suggest that there is a line of code needed to direct admins, (when logging in) to a particular page.

    Does'nt this include NEW signups?

    Jose could you elaborate.
    bloginfo('url')?

  • Andrew
    • Champion of Loops

    Hiya,

    Again, the redirect is setup *before* the login takes place. So you can only specify full paths. You cannot redirect the user to their blog admin panel because until the user is logged in the plugin can't know which blog to send the user to.

    If you just want to redirect the users to their profile page on the main blog try this:

    $login_redirect_url = 'http://domain.tld/wp-admin/profile.php';

    Thanks,
    Andrew

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.