Home › Forums › Plugin Support › Logout from the Admin bar
- This topic has 5 replies, 2 voices, and was last updated 10 years, 2 months ago by FDMaguire.
-
AuthorPosts
-
September 7, 2014 at 11:05 pm #6280September 7, 2014 at 11:25 pm #6281FDMaguireMember
I have done a little more testing. I have noticed that the “Login” in the top left of the admin bar also have changing behavior.
Here is an image of the location I am discussing:
http://bit.ly/1pEVIacIf I click on “Login” while on the primary web site in the multisite network, it takes me to the proper registration page as set in User Meta Pro. If I click on “Login” in the top left on a secondary site in the multisite network load, it takes me here:
http://bit.ly/1pEVYWWWhat is also interesting is that if I click on “Register” in the top left of the admin bar, it takes me to the correct location whether I am on the primary site in the WordPress multisite set-up or I am on a secondary site in the WordPress multisite set-up. So, the “Register” link seems to behave properly regardless.
September 20, 2014 at 11:11 pm #6324FDMaguireMemberTomorrow will be two weeks since I originally posted this message. I know schedules get busy, but I am really hoping for some support on this topic as I cannot take our online community live until it is resolved.
Thanks!
September 21, 2014 at 1:01 am #6332KhaledMemberHi,
Sorry for being late. In multisite, if the user is a member of site and has a role, you can configure redirection by user-meta settings tab. Make sure that, you configured for the correct role. If you select, redirect to login page, don’t forget to select a login page under User Meta >> Settings (Login Tab).
However, if the current user is not a member of current site or has no role to current site, then he/she will be redirected to wp default (login page) after logout. As in UMP settings, there are no option to configure for no-role, you can add following code to your functions.php to allow non-member/non-role to redirect to targeted url.
add_filter( 'user_meta_logout_redirect', 'redirectForNonMember', 50, 2 ); function redirectForNonMember($redirect, $user) { $role = reset( $user->roles ); if ( empty( $role ) ) { $redirect = 'http://example.com'; } return $redirect; }
Thanks.
September 21, 2014 at 1:06 am #6333KhaledMemberIt is better to specify your login and registration page on User Meta >> Settings page for every site under the network, including primary site. Because, every site follows different UMP settings.
September 26, 2014 at 9:08 pm #6360FDMaguireMemberThanks Khaled.
Any thought given to permit network wide settings applied at the Super Admin level?
Going further, possibly even consider allowing us to sponsor the cost of that development if it does not currently make sense to be higher up on your development road map for most users?
It would save us a huge amount of time and also make the additional of new sites to the network not require us running out to each new site and going to the UMP settings on that site.
- This reply was modified 10 years, 2 months ago by FDMaguire.
-
AuthorPosts
- You must be logged in to reply to this topic.