mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Docs: Improve docblock for $x_redirect_by param in wp_redirect().
The `$x_redirect_by` parameter is supported by `wp_redirect()` and `wp_safe_redirect()` to set the `X-Redirect-By` header. It can be modified via the `x_redirect_by` filter. This updates the docblock to clarify that `false` can be passed to disable sending the header, which was previously undocumented behavior. Props kkmuffme, swissspidy. Fixes #60209. git-svn-id: https://develop.svn.wordpress.org/trunk@57693 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2f4cc966e9
commit
34fb70014e
@ -1379,7 +1379,7 @@ if ( ! function_exists( 'wp_redirect' ) ) :
|
||||
*
|
||||
* @param string $location The path or URL to redirect to.
|
||||
* @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily).
|
||||
* @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'.
|
||||
* @param string|false $x_redirect_by Optional. The application doing the redirect or false to omit. Default 'WordPress'.
|
||||
* @return bool False if the redirect was canceled, true otherwise.
|
||||
*/
|
||||
function wp_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) {
|
||||
@ -1426,7 +1426,7 @@ if ( ! function_exists( 'wp_redirect' ) ) :
|
||||
*
|
||||
* @since 5.1.0
|
||||
*
|
||||
* @param string $x_redirect_by The application doing the redirect.
|
||||
* @param string|false $x_redirect_by The application doing the redirect or false to omit the header.
|
||||
* @param int $status Status code to use.
|
||||
* @param string $location The path to redirect to.
|
||||
*/
|
||||
@ -1522,7 +1522,7 @@ if ( ! function_exists( 'wp_safe_redirect' ) ) :
|
||||
*
|
||||
* @param string $location The path or URL to redirect to.
|
||||
* @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily).
|
||||
* @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'.
|
||||
* @param string|false $x_redirect_by Optional. The application doing the redirect or false to omit. Default 'WordPress'.
|
||||
* @return bool False if the redirect was canceled, true otherwise.
|
||||
*/
|
||||
function wp_safe_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user