Add redirect param to wp_loginout(). Props Denis-de-Bernardy. fixes #9241

git-svn-id: http://svn.automattic.com/wordpress/trunk@11101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-27 20:00:59 +00:00
parent 2eb1947d03
commit 036a36a7e8

View File

@ -136,12 +136,14 @@ function get_search_form() {
*
* @since 1.5.0
* @uses apply_filters() Calls 'loginout' hook on HTML link content.
*
* @param string $redirect Optional path to redirect to on login/logout.
*/
function wp_loginout() {
function wp_loginout($redirect = '') {
if ( ! is_user_logged_in() )
$link = '<a href="' . wp_login_url() . '">' . __('Log in') . '</a>';
$link = '<a href="' . clean_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>';
else
$link = '<a href="' . wp_logout_url() . '">' . __('Log out') . '</a>';
$link = '<a href="' . clean_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
echo apply_filters('loginout', $link);
}