bbPress and redirect_to
-
I have two websites running custom php to create Log In/Log Out entries on the menu.
The Log Out behavior is different on the two websites. I finally tracked down the problem to bbPress. The URL created by my custom code with w_logout_url() on the bbPress site includes:
&redirect_to=…where the URL created by the site without bbPress installed does not.
Disabling bbPpress removes the &redirect_to=… and reenabling bbPress makes the redirect_to return.
That leads me to believe bbPress is changing /setting this value somewhere, but I don’t see any choice to change that value in the bbPress settings?
add_filter( 'wp_nav_menu_items', 'ccc_add_loginout_link', 10, 2 ); function ccc_add_loginout_link( $items, $args ) { if (is_user_logged_in() && $args->theme_location == 'header-menu') { $items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>'; } elseif (!is_user_logged_in() && $args->theme_location == 'header-menu') { $items .= '<li><a href="'. site_url('wpflogin') .'">Log In</a></li>'; } return $items; }
Thanks!!
- You must be logged in to reply to this topic.