Uses
Uses | Description |
---|---|
wp-includes/formatting.php: wp_unslash() | Remove slashes from a string or array of strings. |
wp-includes/formatting.php: esc_attr() | Escaping for HTML attributes. |
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.
(bool) (Optional) Whether to echo or return the referer field.
Default value: true
(string) Referer field HTML markup.
File: wp-includes/functions.php
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; }
Version | Description |
---|---|
2.0.4 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_referer_field