Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 5 months ago

#4648 closed enhancement (invalid)

Addition to the function wp_loginout ()

Reported by: jorgeka's profile 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)

#1 @foolswisdom
17 years ago

  • Milestone set to 2.4 (future)

#2 @Nazgul
17 years ago

Couldn't you achieve the same result by hooking into the loginout filter?

#3 @weasello
17 years ago

  • Resolution set to invalid
  • Status changed from new to closed

#4 @darkdragon
17 years ago

  • Milestone 2.4 deleted

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:

@isabel_brison commented on PR #4713:


15 months ago
#6

committed in r56052 / 3d551af

Note: See TracTickets for help on using tickets.