Skip to:
Content

bbPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2778 closed enhancement (fixed)

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

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

Description

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
10 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
10 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
10 years ago

In 5659:

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

Note: See TracTickets for help on using tickets.