Changeset 4533
- Timestamp:
- 11/28/2012 09:33:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/template-tags.php
r4529 r4533 1085 1085 * 1086 1086 * The referer link is the current Request URI from the server super global. The 1087 * input name is ' _wp_http_referer', in case you wanted to check manually.1087 * input name is 'redirect_to', in case you wanted to check manually. 1088 1088 * 1089 1089 * @since bbPress (r2815) 1090 1090 * 1091 * @param string $url Pass a URL to redirect to 1091 * @param string $redirect_to Pass a URL to redirect to 1092 * 1092 1093 * @uses wp_get_referer() To get the referer 1093 1094 * @uses esc_attr() To escape the url 1094 * @uses apply_filters() Calls 'bbp_redirect_to_field' with the referer field 1095 * and url 1095 * @uses apply_filters() Calls 'bbp_redirect_to_field', passes field and to 1096 1096 */ 1097 1097 function bbp_redirect_to_field( $redirect_to = '' ) { 1098 1099 // Rejig the $redirect_to1100 if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( !$redirect_to == home_url( $_SERVER['REDIRECT_URL'] ) ) )1101 $redirect_to = wp_get_referer();1102 1098 1103 1099 // Make sure we are directing somewhere 1104 1100 if ( empty( $redirect_to ) ) 1105 $redirect_to = home_url( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '');1101 $redirect_to = home_url( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : wp_get_referer() ); 1106 1102 1107 1103 // Remove loggedout query arg if it's there
Note: See TracChangeset
for help on using the changeset viewer.