Languages: English • 日本語 (Add your language)
Retrieve referer from '_wp_http_referer', HTTP referer, or current page respectively.
<?php wp_get_referer(); ?>
None.
<?php
if ( wp_get_referer() )
{
wp_safe_redirect( wp_get_referer() );
}
else
{
wp_safe_redirect( get_home_url() );
}
?>
Since: 2.0.4
wp_get_referer() is located in wp-includes/functions.php.