WPDev.one
Core Function
View Source on Trac ↗

wp_safe_redirect()

wp_safe_redirect( mixed $location, mixed $status = 302, mixed $x_redirect_by = 'WordPress' )

Performs a safe (local) redirect, using wp_redirect().

Parameters 2 required

Name / Type Description
$location
string

The path or URL to redirect to.

Required
$status
int

Optional. HTTP response status code to use. Default '302' (Moved Temporarily).

(string

| false) $x_redirect_by Optional. The application doing the redirect or false to omit. Default 'WordPress'.

Required

Return Value

(bool)
False if the redirect was canceled, true otherwise.

Function Information

Since Version
2.3.0
Source File
wp-includes/pluggable.php
Advertisement