Commit 5b4827ea authored by Andrew Nacin's avatar Andrew Nacin
Browse files

Keep redirect_to when hitting the log out AYS.

props mitchoyoshitaka for initial patch.
fixes #17398.

Built from https://develop.svn.wordpress.org/trunk@27272


git-svn-id: https://core.svn.wordpress.org/trunk@27128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 49ff05fa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2080,7 +2080,8 @@ function wp_nonce_ays( $action ) {
	$title = __( 'WordPress Failure Notice' );
	if ( 'log-out' == $action ) {
		$html = sprintf( __( 'You are attempting to log out of %s' ), get_bloginfo( 'name' ) ) . '</p><p>';
		$html .= sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() );
		$redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
		$html .= sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url( $redirect_to ) );
	} else {
		$html = __( 'Are you sure you want to do this?' );
		if ( wp_get_referer() )