wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_get_referer › WordPress Function
Since2.0.4
Deprecatedn/a
› wp_get_referer ( No parameters )
Returns: |
|
Defined at: |
|
Codex: |
Retrieves referer from '_wp_http_referer' or HTTP referer.
If it's the same as the current request URL, will return false.Related Functions: wp_get_raw_referer, wp_get_original_referer, wp_get_theme, wp_get_theme_error, wp_referer_field
Source
function wp_get_referer() { // Return early if called before wp_validate_redirect() is defined. if ( ! function_exists( 'wp_validate_redirect' ) ) { return false; } $ref = wp_get_raw_referer(); if ( $ref && wp_unslash( $_SERVER['REQUEST_URI'] ) !== $ref && home_url() . wp_unslash( $_SERVER['REQUEST_URI'] ) !== $ref ) { return wp_validate_redirect( $ref, false ); } return false; }