Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'logout redirect'

Viewing 25 results - 51 through 75 (of 127 total)
  • Author
    Search Results
  • #166341
    bp-help
    Participant

    @famous
    Try this just make sure you follow the instructions in the commented code. Place it in bp-custom.php :

    
    /* Redirects to profile upon login, and upon logout redirects to activity page unless changed in line 6 */
    function bp_help_redirect_to_profile(){
     global $bp_unfiltered_uri;
    
     $bphelp_my_home_page = 'activity';  // WARNING: make sure you replace 'activity' in this line to the same thing you set dashboard/settings/reading front page to.
    
     if ( !is_user_logged_in() && ( $bp_unfiltered_uri[0] != $bphelp_my_home_page ) ) 
      bp_core_redirect( get_option('home') );
    
     elseif( is_user_logged_in() && ( $bp_unfiltered_uri[0] == 'activity') )
    	bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile' );
    
    }
    	
    add_action( 'wp', 'bp_help_redirect_to_profile', 3 );
    
    #165810
    bp-help
    Participant

    @famous
    That is a little strange. Are using mutisite? On a single site BP install the login/logout shows in the sidebar with the Meta Widget. Are you using a full width template? If so you can use this plugin to provide a login in the toolbar which I use with a full page template with WP 3.5.1 and BP 1.7.2 and it works, get it here:
    https://wordpress.org/plugins/admin-bar-login/
    Please provide as much info as you can on your install. If I can’t help, it will help others to help you. Thanks!

    #165746
    bp-help
    Participant

    @famous
    To redirect to profile add the following code courtesy of @sbrajesh at BuddyDev to your bp-custom.php :

    
    /*Make sure profile is default component*/
    define('BP_DEFAULT_COMPONENT','profile');
    
    /*let us filter where to redirect */
    add_filter("login_redirect","bpdev_redirect_to_profile",10,3);
     
    function bpdev_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user)
    {
    if(empty($redirect_to_calculated))
    $redirect_to_calculated=admin_url();
     
    /*if the user is not site admin,redirect to his/her profile*/
    if(!is_site_admin($user->user_login))
    return bp_core_get_user_domain($user->ID );
    else
    return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/
     
    }
    

    For logout use the following code also courtesy of @sbrajesh to redirect back to your home url:

    
    add_filter('logout_url',"bpdev_logout_url",100,2);
    function bpdev_logout_url( $logout_url, $redirect) {
    //simply ignore the redirect and set it to the main domain
    //let us check for buddyopress,if yes,let us get the bp root domain right ?
    if(function_exists("bp_core_get_root_domain"))
    $redirect=bp_core_get_root_domain();
    else
    $redirect = get_blog_option( SITE_ID_CURRENT_SITE, 'siteurl' );
    
    $args = array( 'action' => 'logout' );
    if ( !empty($redirect) ) {
    $args['redirect_to'] = $redirect;
    }
    
    $logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));
    $logout_url = wp_nonce_url( $logout_url, 'log-out' );
    
    return $logout_url;
    }
    
    #162379
    pfrey
    Participant

    Yeah, I ran across that webpage and I did try using home_url() and still had the same redirection after logging out.

    I found the Peter’s Login Redirect plugin today, and it worked for me. It’s a little overkill for what I need it for, but it’s the only thing I could do to make it work!

    So if you have any other ideas, I’m open to them, otherwise I suppose I will be using the extra plugin.

    Thanks!

    #162366
    David Cavins
    Keymaster

    Still didn’t work. Available here: http://pastebin.com/ZtFWhqyg

    #162365
    David Cavins
    Keymaster

    Well that code bit got mixed up, let’s try that again:

    `<a href="” title=”Log out”>`

    #162364
    David Cavins
    Keymaster

    Hi Patty-

    Have you tried using `home_url()` instead of `site_url()` like the example on the Codex: https://codex.wordpress.org/Function_Reference/wp_logout_url#Logout_and_Redirect_to_Homepage

    I use this on my site and it redirects to the home page:
    `<a href="” title=”Log out”>`

    -David

    #162338
    pfrey
    Participant

    I’ve seen some other tickets from a long time ago, but didn’t want to re-open a dead ticket. But none of them seemed to be resolved. If anyone can help me I’d really appreciate it.

    #153668
    modemlooper
    Moderator
    #153667
    freddy mcbob
    Participant

    @modemlooper that didnt work… It said I had an error.

    #153666
    modemlooper
    Moderator

    replace text URL-after-logout with a url

    #153665
    freddy mcbob
    Participant

    @modemlooper for this code:
    `add_filter(‘logout_url’, ‘my_filtered_logout’);
    my_filtered_logout($logout_url, $redirect) { return “URL-after-logout”; }` where do I put the URL where I want members to get redirected to?

    #143943
    mattriggins
    Participant

    Only plugin that is active is Buddypress. Installed BP FriendPress, same issue. Once I logout, I get a redirect that goes no where and the screen is blank.

    Then, if I open a new window and go back to domain.com, it still shows me as logged in.

    I then opened a different browser, and went to domain.com. I put in my login info and tried to login. I again go to a blank white page, sitting at http://domain.com/wp-login.php

    If I refresh the page on the 2nd browser, it takes me back to domain.com/register

    Strange!

    #141781
    modemlooper
    Moderator

    You can also filter logout link. Place this in bp-custom.php or your themes functions.php

    `add_filter(‘logout_url’, ‘my_filtered_logout’);
    my_filtered_logout($logout_url, $redirect) { return “URL-after-logout”; }`

    #141775
    erikahrend
    Member

    Hi again, and sorry for the hassle. I am using Mingle Theme for Buddypress. Mingle allows for two menus (right and left). I have currently set the logout button to the right menu (and to be visible only when users are logged in). I guess what I´m wondering is if there is a way of actually setting the redirection function from within the menu (in the button, in the classes or in the link code).

    Thanks again for your time.

    Erik.

    #141773
    modemlooper
    Moderator

    Anywhere you want a logout link you can place the code. Header.php will show on everypage

    home_url() is the site you’re on main page. If you want another URL use code below and put in URL you want

    `<a href="” title=”Logout”>Logout`

    #141772
    erikahrend
    Member

    Hi and thanks for your reply. Would you mind explaining where exactly I need to insert that code, and also, if, for instance, my home page is: http://www.canarias2nite.com , where in the code provided would I insert the url?

    Excuse my complete lack of coding skills, I just wish I knew better..

    Best,

    Erik.

    #141747
    modemlooper
    Moderator

    `<a href="” title=”Logout”>Logout`

    #140120
    iamdhunt
    Participant

    Thanks I got the redirect logout to work by using the function from here: http://projectivemotion.com/2011/07/27/wordpress-always-redirect-to-homepage-after-logout/

    Still looking to change the link on the toolbar’s My Account from “Edit Profile” to “Activity”

    #140040
    danbpfr
    Participant
    #138168

    In reply to: how to avoid this

    @mercime
    Participant

    == I got this two login forms and link to registration page on two side bars ==

    Open up one of your sidebar templates and remove the login form. Looks strange to have two.

    == how can I redirect this I mean logging out in any shape or form to redirect to registration page. ==

    WP Codex is your friend https://codex.wordpress.org/Function_Reference/wp_logout_url

    #136330

    In reply to: redirect user login

    valuser
    Participant

    https://wordpress.org/extend/plugins/buddypress-login-redirect/ can redirect to 3 different locations after login. 1. Personal Profile / Personal Activity Page 2. Site wide Activity 3. Friends’ Activity

    https://wordpress.org/extend/plugins/login-with-ajax/ this plugin’s settings allows you go to any particular page OR to the current users particular page on login & on logout if you use %USERNAME% — its on the settings page

    #130398
    Boone Gorges
    Keymaster

    To elaborate on what @DJPaul said – BP uses WP’s logout, which is handled by wp-login.php. In particular, a request is sent to wp-login.php?action=logout, with a redirect_to argument of the current BP page.

    #128849
    FLXweb
    Member

    I’m not sure why the activate page is still there as the email now has an automated link but I have figured a way to rectify this! Just install a wp redirection plugin and forward the activate page to whatever URL you would like! I also would recommend using the the login logout redirect plugin!

    #126271
    Flocktome
    Member

    I’m having the same problem as @mwbarker

    It’s all the latest updates. I run my live site with w3TC, have disabled cacheing for logged in users, but still having this problem.

    My localhost test site has W3TC disabled, and it’s no problems. I guess I’ll have togo through all settings one by one until i find out what’s causing this.

    <– Edit.

    Ok, this is weird….
    I believe this has to do with “Page Cache” settings.

    I disabled Cache home page (now, I can loign/logout no probs)
    Selected “Don’t cache pages for logged in users”

    Now, as a test, I visited a few of my pages, log out, no probs. Stay logged out.

    Now, if I visit a page, say “About”, if I login on that page, I can logout, visit the homepage, I’m logged out, but if I visit that page again, it shows me as logged in. When I try to logout of “About”, it send me to the:

    http://mywebsite.com/wp-login.php?action=logout&redirect_to=http%3A%2F%2Fmywebsite.com&_wpnonce=bb1shsjskdd (nonce verify page)

    Very odd.

Viewing 25 results - 51 through 75 (of 127 total)
Skip to toolbar