wp_original_referer_field
函数
wp_original_referer_field ( $echo = true, $jump_back_to = 'current' )
- 参数
-
-
(bool)
$echo
Optional. Whether to echo the original http referer. Default true.- Required: 否
- Default: true
-
(string)
$jump_back_to
Optional. Can be ‘previous’ or page you want to jump back to. Default ‘current’.- Required: 否
- Default: ‘current’
-
(bool)
- 返回值
-
- (string) Original referer field.
- 定义位置
-
-
wp-includes/functions.php
, line 1926
-
wp-includes/functions.php
- 引入
- 2.0.4
- 弃用
- –
Retrieves or displays original referer hidden field for forms.
The input name is ‘_wp_original_http_referer’ and will be either the same
value of wp_referer_field(), if that was posted already or it will be the
current page, if it doesn’t exist.
function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) { $ref = wp_get_original_referer(); if ( ! $ref ) { $ref = ( 'previous' === $jump_back_to ) ? wp_get_referer() : wp_unslash( $_SERVER['REQUEST_URI'] ); } $orig_referer_field = ''; if ( $echo ) { echo $orig_referer_field; } return $orig_referer_field; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。