Make WordPress Core

Opened 14 years ago

Closed 13 years ago

Last modified 10 months ago

#5794 closed enhancement (duplicate)

Easily redirectable wp_loginout

Reported by: gviscardi's profile 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 14 years ago.
Patch file for code modifications to make it easier to redirect logins/outs

Download all attachments as: .zip

Change History (9)

14 years ago

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

#1 @gViscardi
14 years ago

  • Type changed from defect to enhancement

#2 @lloydbudd
14 years ago

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

#4 follow-up: @gViscardi
14 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
14 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 = '';
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
14 years ago

  • Milestone changed from 2.5 to 2.6

#8 @Denis-de-Bernardy
13 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.