Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#5794 closed enhancement (duplicate)

Easily redirectable wp_loginout

Reported by: gViscardi Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.3.3
Component: General Keywords: loginout redirect has-patch
Focuses: Cc:


This modification to the core code of wp_loginout makes it so that users can specify where the viewers go after logging in/out with the same wp_loginout function. This patch also does not break old code, as wp_loginout() still works as normal.

Attachments (1)

general-template.php.diff (1.4 KB) - added by gViscardi 10 years ago.
Patch file for code modifications to make it easier to redirect logins/outs

Download all attachments as: .zip

Change History (9)

10 years ago

Patch file for code modifications to make it easier to redirect logins/outs

#1 @gViscardi
10 years ago

  • Type changed from defect to enhancement

#2 @lloydbudd
10 years ago

  • Keywords has-patch added
  • Milestone changed from 2.6 to 2.5

#4 follow-up: @gViscardi
10 years ago

My solution makes it so that you can redirect to wherever you want from the built-in function call without having to change the plugin/core code each time you wanted to redirect to a different page ( i tried but could not find a way to make this plugin-able), i.e. wp_loginout('loginRedirect=thispageinstead.php') or wp_loginout(logoutRedirect=thatpageinstead.php')

It allows for more theme-based functionality so you can redirect wherever you want from each wp_loginout().

#5 in reply to: ↑ 4 @Viper007Bond
10 years ago

The thing I linked is a plugin -- it's not for modifying any core files. Just upload and activate.

You could also use it to control them on an individual case, but it wouldn't be the most elegant:

global $redirectto;
$redirectto = 'http://www.google.com/';
global $redirectto;

// a modification of the code I posted before that uses $redirectto instead

So yeah, I guess having it as a parameter of wp_loginout() would be useful.

#6 @ffemtcj
10 years ago

  • Milestone changed from 2.5 to 2.6

#8 @Denis-de-Bernardy
9 years ago

  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Fixed in r11101

Note: See TracTickets for help on using tickets.