Changeset 5658 for trunk/src/includes/core/functions.php
- Timestamp:
- 03/24/2015 01:32:20 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/core/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/functions.php
r5481 r5658 584 584 } 585 585 586 /** Redirection ***************************************************************/ 587 588 /** 589 * Perform a safe, local redirect somewhere inside the current site 590 * 591 * On some setups, passing the value of wp_get_referer() may result in an empty 592 * value for $location, which results in an error on redirection. If $location 593 * is empty, we can safely redirect back to the forum root. This might change 594 * in a future version, possibly to the site root. 595 * 596 * @since bbPress (r5658) 597 * 598 * @uses wp_safe_redirect() 599 * 600 * @param string $location The URL to redirect the user to. 601 * @param int $status Optional. The numeric code to give in the redirect 602 * headers. Default: 302. 603 */ 604 function bbp_redirect( $location = '', $status = 302 ) { 605 606 // Prevent errors from empty $location 607 if ( empty( $location ) ) { 608 $location = bbp_get_forums_url(); 609 } 610 611 // Setup the safe redirect 612 wp_safe_redirect( $location, $status ); 613 614 // Exit so the redirect takes place immediately 615 exit(); 616 }
Note: See TracChangeset
for help on using the changeset viewer.