From 7aa0fd9a7889291a33e3e9cdf19ae23ab521c4c6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 4 Sep 2013 08:30:37 +0000 Subject: [PATCH] Add phpdoc for 'wp_redirect' and 'wp_redirect_status' filters. props DrewAPicture. fixes #25215. git-svn-id: https://develop.svn.wordpress.org/trunk@25230 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/pluggable.php | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index 4d5368e345..40a811bd5e 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -857,17 +857,34 @@ if ( !function_exists('wp_redirect') ) : * @since 1.5.1 * @uses apply_filters() Calls 'wp_redirect' hook on $location and $status. * - * @param string $location The path to redirect to - * @param int $status Status code to use + * @param string $location The path to redirect to. + * @param int $status Status code to use. * @return bool False if $location is not provided, true otherwise. */ function wp_redirect($location, $status = 302) { global $is_IIS; - $location = apply_filters('wp_redirect', $location, $status); - $status = apply_filters('wp_redirect_status', $status, $location); + /** + * Filter the redirect location + * + * @since 2.1.0 + * + * @param string $location The path to redirect to. + * @param int $status Status code to use. + */ + $location = apply_filters( 'wp_redirect', $location, $status ); - if ( !$location ) // allows the wp_redirect filter to cancel a redirect + /** + * Filter the redirect status code + * + * @since 2.3.0 + * + * @param int $status Status code to use. + * @param string $location The path to redirect to. + */ + $status = apply_filters( 'wp_redirect_status', $status, $location ); + + if ( ! $location ) return false; $location = wp_sanitize_redirect($location);