wp_get_original_referer

Retrieve original referer that was posted, if it exists.

Description

(string|false) wp_get_original_referer(); 

Returns (string|false)

False if no original referer or original referer if set.


Usage

  1. if ( !function_exists( 'wp_get_original_referer' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_get_original_referer(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function wp_get_original_referer() { 
  2. if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) ) 
  3. return wp_validate_redirect( wp_unslash( $_REQUEST['_wp_original_http_referer'] ), false ); 
  4. return false;