Make WordPress Core

Ticket #42108: pass_the_return_from_wp_redirect_on_clean.patch

File pass_the_return_from_wp_redirect_on_clean.patch, 1.3 KB (added by Drivingralle, 6 years ago)

Same patch. Without code style changes. Better doc block.

  • src/wp-includes/pluggable.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    12851285 *     wp_safe_redirect( $url );
    12861286 *     exit;
    12871287 *
     1288 * Exiting can also be selectively manipulated by using wp_redirect() as a conditional
     1289 * in conjunction with the {@see 'wp_redirect'} and {@see 'wp_redirect_location'} filters:
     1290 *
     1291 *     if ( wp_safe_redirect( $url ) ) {
     1292 *         exit;
     1293 *     }
     1294 *
    12881295 * @since 2.3.0
     1296 * @since 5.0.0 Added passing the return from wp_redirect on.
    12891297 *
    12901298 * @param string $location The path or URL to redirect to.
    12911299 * @param int    $status   Optional. HTTP response status code to use. Default '302' (Moved Temporarily).
     1300 * @return bool  $redirect False if the redirect was cancelled, true otherwise.
    12921301 */
    12931302function wp_safe_redirect($location, $status = 302) {
    12941303
     
    13051314         */
    13061315        $location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );
    13071316
    1308         wp_redirect($location, $status);
     1317        return wp_redirect($location, $status);
    13091318}
    13101319endif;
    13111320