wp_referer_field()为表格获取或显示引用页隐藏字段

目录

描述

译文

为表格检索或显示引用页隐藏字段。

引用页链接即来自服务器超级全局变量的当前请求URI。如果希望手动检索,请使用输入名称'_wp_http_referer'。

原文

Retrieves or displays the referer hidden form field.

The referer field value will be the value of the 'REQUEST_URI' element of the $_SERVER PHP superglobal variable, and the field name will be '_wp_http_referer' , in case you wanted to check manually.

wp_referer_field() 描述

用法

<?php wp_referer_field$echo ?>

wp_referer_field() 用法

参数

$echo

(boolean) (可选) Whether to display or return the referer hidden form field.

默认值: true

wp_referer_field() 参数

返回值

(string) 

Referer field.

wp_referer_field() 返回值

历史

添加于 版本: 2.0.4

wp_referer_field() 历史

源文件

wp_referer_field() 函数的代码位于 wp-includes/functions.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Retrieve or display referer hidden field for forms.
 *
 * The referer link is the current Request URI from the server super global. The
 * input name is '_wp_http_referer', in case you wanted to check manually.
 *
 * @since 2.0.4
 *
 * @param bool $echo Optional. Whether to echo or return the referer field. Default true.
 * @return string Referer field HTML markup.
 */
function wp_referer_field( $echo = true ) {
	$referer_field = '';

	if ( $echo )
		echo $referer_field;
	return $referer_field;
}

wp_referer_field() 源文件

相关