Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_get_referer [ WordPress Function ]

wp_get_referer ( No parameters )
Returns:
  • (string|bool) False on failure. Referer URL on success.
Defined at:



Retrieve referer from '_wp_http_referer' or HTTP referer. If it's the same as the current request URL, will return false.

Source


<?php
function wp_get_referer() {
    
$ref false;
    if ( ! empty( 
$_REQUEST['_wp_http_referer'] ) )
        
$ref $_REQUEST['_wp_http_referer'];
    else if ( ! empty( 
$_SERVER['HTTP_REFERER'] ) )
        
$ref $_SERVER['HTTP_REFERER'];

    if ( 
$ref && $ref !== $_SERVER['REQUEST_URI'] )
        return 
$ref;
    return 
false;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics