#4648 closed enhancement (invalid)
Addition to the function wp_loginout ()
Reported by: | jorgeka | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | trivial | Version: | |
Component: | General | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
It's just a small thing that bothered me a tiny bit; each time I wanted the wp_loginout () to take the user to some other page, I had to manually type the redirect_to-link in the document, and to save myself of writing 10-20 characters the few times I wanted it to take the user somewhere, I added the redirect_to as a parameter to the function, leaving it to look something like this:
function wp_loginout($redirect_to = '/') {
if ( ! is_user_logged_in() )
$link = '<a href="' . get_option('siteurl') . '/wp-login.php?redirect_to=' . $redirect_to . '">' . __('Login') . '</a>';
else
$link = '<a href="' . get_option('siteurl') . '/wp-login.php?action=logout&redirect_to=' . $redirect_to . '">' . __('Logout') . '</a>';
echo apply_filters('loginout', $link);
}
Change History (6)
#3
@
17 years ago
- Resolution set to invalid
- Status changed from new to closed
You can indeed and it has already been done:
http://www.thedailyblitz.org/weasels-login-redirect-text-replacement-plugin
This ticket was mentioned in PR #4713 on WordPress/wordpress-develop by @ramonopoly.
15 months ago
#5
- Keywords has-patch has-unit-tests added
Trac ticket:
Note: See
TracTickets for help on using
tickets.
Couldn't you achieve the same result by hooking into the loginout filter?