WordPress at a glance

wp_referer_field() WP 1.0

Retrieve or display referer hidden field for forms.

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.

No Hooks.


String. Referer field HTML markup.


wp_referer_field( $echo );
Whether to echo or return the referer field.
Default: true

Code of wp_referer_field: wp-includes/functions.php VER 4.9.8

function wp_referer_field( $echo = true ) {
	$referer_field = '<input type="hidden" name="_wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';

	if ( $echo )
		echo $referer_field;
	return $referer_field;

Related Functions

From tag: form functions

More from tag: nonce (security protection defence)

More from category: Security

No comments
    Hello, !     Log In . Register