wc_get_raw_referer

Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.

Description

(string|false) wc_get_raw_referer(); 

Do not use for redirects, use woocommerce/3.0.6/functions/wp_get_referer/" title="wp_get_referer" class="code function">wp_get_referer() instead.

Returns (string|false)

Referer URL on success, false on failure.


Usage

  1. if ( !function_exists( 'wc_get_raw_referer' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-cart-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_get_raw_referer(); 
  7.  

Defined (1)

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

/includes/wc-cart-functions.php  
  1. function wc_get_raw_referer() { 
  2. if ( function_exists( 'wp_get_raw_referer' ) ) { 
  3. return wp_get_raw_referer(); 
  4.  
  5. if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) { 
  6. return wp_unslash( $_REQUEST['_wp_http_referer'] ); 
  7. } elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) { 
  8. return wp_unslash( $_SERVER['HTTP_REFERER'] ); 
  9.  
  10. return false;