wp_get_original_referer()WP 2.0.4

Retrieves original referer that was posted, if it exists.

Хуков нет.

Возвращает

Строку|false. Original referer URL on success, false on failure.

Использование

wp_get_original_referer();

Список изменений

С версии 2.0.4 Введена.

Код wp_get_original_referer() WP 6.6.2

function wp_get_original_referer() {
	// Return early if called before wp_validate_redirect() is defined.
	if ( ! function_exists( 'wp_validate_redirect' ) ) {
		return false;
	}

	if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) ) {
		return wp_validate_redirect( wp_unslash( $_REQUEST['_wp_original_http_referer'] ), false );
	}

	return false;
}