Search Results for 'logout redirect'
-
AuthorSearch Results
-
June 18, 2013 at 8:13 pm #166341
In reply to: redirect to profile page?
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 );June 12, 2013 at 4:17 am #165810In reply to: redirect to profile page?
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!June 11, 2013 at 3:29 am #165746In reply to: redirect to profile page?
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; }April 22, 2013 at 8:00 pm #162379In reply to: On logout, page redirects to WP Login
pfrey
ParticipantYeah, 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!
April 22, 2013 at 5:59 pm #162366In reply to: On logout, page redirects to WP Login
David Cavins
KeymasterStill didn’t work. Available here: http://pastebin.com/ZtFWhqyg
April 22, 2013 at 5:58 pm #162365In reply to: On logout, page redirects to WP Login
David Cavins
KeymasterWell that code bit got mixed up, let’s try that again:
`<a href="” title=”Log out”>`
April 22, 2013 at 5:56 pm #162364In reply to: On logout, page redirects to WP Login
David Cavins
KeymasterHi 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
April 22, 2013 at 2:38 pm #162338In reply to: On logout, page redirects to WP Login
pfrey
ParticipantI’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.
February 22, 2013 at 12:13 am #153668In reply to: Logout button redirect to home page
modemlooper
Moderatoryou can include a hard coded link https://codex.wordpress.org/Function_Reference/wp_logout_url
February 21, 2013 at 11:57 pm #153667In reply to: Logout button redirect to home page
freddy mcbob
Participant@modemlooper that didnt work… It said I had an error.
February 21, 2013 at 11:56 pm #153666In reply to: Logout button redirect to home page
modemlooper
Moderatorreplace text URL-after-logout with a url
February 21, 2013 at 11:42 pm #153665In reply to: Logout button redirect to home page
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?October 25, 2012 at 6:07 am #143943In reply to: Activity Stream Change…
mattriggins
ParticipantOnly 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!
September 16, 2012 at 3:48 am #141781In reply to: Logout button redirect to home page
modemlooper
ModeratorYou 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”; }`September 16, 2012 at 1:10 am #141775In reply to: Logout button redirect to home page
erikahrend
MemberHi 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.
September 15, 2012 at 11:57 pm #141773In reply to: Logout button redirect to home page
modemlooper
ModeratorAnywhere 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`
September 15, 2012 at 11:17 pm #141772In reply to: Logout button redirect to home page
erikahrend
MemberHi 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.
September 15, 2012 at 2:29 pm #141747In reply to: Logout button redirect to home page
modemlooper
Moderator`<a href="” title=”Logout”>Logout`
August 24, 2012 at 10:08 am #140120In reply to: Change redirect link on Toolbar
iamdhunt
ParticipantThanks 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”
August 23, 2012 at 10:20 am #140040In reply to: Change redirect link on Toolbar
danbpfr
Participanthello,
view here:https://codex.wordpress.org/Function_Reference/wp_logout_url
and here for inspiration
http://wordpress.stackexchange.com/questions/15049/buddypress-redirects-on-login-and-logoutJuly 30, 2012 at 6:03 am #138168In 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
June 24, 2012 at 4:36 pm #136330In reply to: redirect user login
valuser
Participanthttps://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
February 24, 2012 at 4:15 pm #130398Boone Gorges
KeymasterTo 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.
January 30, 2012 at 6:59 pm #128849In reply to: How Do I get rid of the activation code?
FLXweb
MemberI’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!
December 14, 2011 at 11:52 am #126271In reply to: W3 Total Cache and Buddypress Log out issues
Flocktome
MemberI’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.
-
AuthorSearch Results