Changeset 42647
- Timestamp:
- 02/04/2018 04:04:10 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r42633 r42647 1187 1187 * 1188 1188 * @since 1.5.1 1189 * @since 5.0.0 The `$x_redirect_by` parameter was added. 1189 1190 * 1190 1191 * @global bool $is_IIS … … 1324 1325 * 1325 1326 * @since 2.3.0 1326 * @since 5.0.0 The return value from wp_redirect() is now passed on. 1327 * 1328 * @param string $location The path or URL to redirect to. 1329 * @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily). 1330 * @return bool $redirect False if the redirect was cancelled, true otherwise. 1331 */ 1332 function wp_safe_redirect( $location, $status = 302 ) { 1327 * @since 5.0.0 The return value from wp_redirect() is now passed on, and the `$x_redirect_by` parameter was added. 1328 * 1329 * @param string $location The path or URL to redirect to. 1330 * @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily). 1331 * @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'. 1332 * @return bool $redirect False if the redirect was cancelled, true otherwise. 1333 */ 1334 function wp_safe_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) { 1333 1335 1334 1336 // Need to look at the URL the way it will end up in wp_redirect() … … 1345 1347 $location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) ); 1346 1348 1347 return wp_redirect( $location, $status );1349 return wp_redirect( $location, $status, $x_redirect_by ); 1348 1350 } 1349 1351 endif; -
trunk/tests/phpunit/tests/pluggable.php
r42633 r42647 184 184 'wp_safe_redirect' => array( 185 185 'location', 186 'status' => 302, 186 'status' => 302, 187 'x_redirect_by' => 'WordPress', 187 188 ), 188 189 'wp_validate_redirect' => array(
Note: See TracChangeset
for help on using the changeset viewer.