Switch language

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




wp_original_referer_field [ WordPress Function ]

wp_original_referer_field ( $echo = true, $jump_back_to = 'current' )
Parameters:
  • (bool) $echo Whether to echo the original http referer
  • (string) $jump_back_to Optional, default is 'current'. Can be 'previous' or page you want to jump back to.
Returns:
  • (string) Original referer field.
Defined at:



Retrieve or display original referer hidden field for forms.

The input name is '_wp_original_http_referer' and will be either the same value of {@link wp_referer_field()}, if that was posted already or it will be the current page, if it doesn't exist.

Source


<?php
function wp_original_referer_field$echo true$jump_back_to 'current' ) {
    
$jump_back_to = ( 'previous' == $jump_back_to ) ? wp_get_referer() : $_SERVER['REQUEST_URI'];
    
$ref = ( wp_get_original_referer() ) ? wp_get_original_referer() : $jump_back_to;
    
$orig_referer_field '<input type="hidden" name="_wp_original_http_referer" value="' esc_attrstripslashes$ref ) ) . '" />';
    if ( 
$echo )
        echo 
$orig_referer_field;
    return 
$orig_referer_field;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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