Functions

Retrieve original referer that was posted, if it exists.

wp_get_original_referer() : string | boolean
package WordPress
package WordPress
subpackage Security
since 2.0.4

Returns

stringbooleanFalse if no original referer or original referer if set.

Retrieve referer from '_wp_http_referer', HTTP referer, or current page respectively.

wp_get_referer() : string | boolean
package WordPress
package WordPress
subpackage Security
since 2.0.4

Returns

stringbooleanFalse on failure. Referer URL on success.

Retrieve or display original referer hidden field for forms.

wp_original_referer_field(boolean $echo = true, string $jump_back_to = 'current') : string

The input name is '_wp_original_http_referer' and will be either the same value of wp_referer_field(), if that was posted already or it will be the current page, if it doesn't exist.

package WordPress
package WordPress
subpackage Security
since 2.0.4

Parameters

$echo

boolean

Whether to echo the original http referer

$jump_back_to

string

Optional, default is 'current'. Can be 'previous' or page you want to jump back to.

Returns

stringOriginal referer field.

Retrieve or display referer hidden field for forms.

wp_referer_field(boolean $echo = true) : string

The referer link is the current Request URI from the server super global. The input name is '_wp_http_referer', in case you wanted to check manually.

package WordPress
package WordPress
subpackage Security
since 2.0.4

Parameters

$echo

boolean

Whether to echo or return the referer field.

Returns

stringReferer field.