Skip to:
Content

Opened 4 years ago

Closed 4 years ago

Last modified 4 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:
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
4 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
4 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
4 years ago

In 5659:

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

Note: See TracTickets for help on using tickets.