From 8a7a62bb11017a8cebd8e2969658102676b78c05 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 26 Jun 2016 07:45:31 +0000 Subject: [PATCH] Docs: Add two simple usage examples to the DocBlock for `wp_redirect()`. See #32246. git-svn-id: https://develop.svn.wordpress.org/trunk@37863 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/pluggable.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index d590b449e0..8b643598ac 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -1127,6 +1127,19 @@ if ( !function_exists('wp_redirect') ) : /** * Redirects to another page. * + * Note: wp_redirect() does not exit automatically, and should almost always be + * followed by a call to `exit;`: + * + * wp_redirect( $url ); + * exit; + * + * Exiting can also be selectively manipulated by using wp_redirect() as a conditional + * in conjunction with the {@see 'wp_redirect'} and {@see 'wp_redirect_location'} hooks: + * + * if ( wp_redirect( $url ) { + * exit; + * } + * * @since 1.5.1 * * @global bool $is_IIS