Skip to:

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2778 closed enhancement (fixed)

Introduce bbp_redirect() to wrap wp_safe_redirect() & exit()

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: minor Version: 2.0
Component: API Keywords:


Since all of bbPress's redirects happen theme-side, we use wp_safe_redirect() everywhere, and in 50+ locations. We also need to remember to exit() when doing so, which isn't difficult, but has caused bugs in the past.

BuddyPress uses bp_core_redirect() for this, and it has worked very well at preventing the introduction of new bugs surrounding redirection.

Change History (3)

#1 @johnjamesjacoby
7 years ago

  • Summary changed from Introduce bbp_redirect() to wrap wp_safe_redirect() to Introduce bbp_redirect() to wrap wp_safe_redirect() & exit()

#2 @johnjamesjacoby
7 years ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from new to closed

In 5658:

API: Introduce bbp_redirect()

  • Wraps wp_safe_redirect() & exit() calls
  • Prevents errors from potentially empty wp_get_referrer() results
  • Replace wp_safe_redirect() usages with bbp_redirect()

Fixes #2778.

#3 @johnjamesjacoby
7 years ago

In 5659:

API: Add more context tobbp_redirect() documentation. See #2778.

Note: See TracTickets for help on using tickets.