get_query_var()
get_query_var( string $var, mixed $default = ” ) 在WP_Qu…
get_query_var( string $var, mixed $default = ” )
在WP_Query类中检索变量。
Retrieve variable in the WP_Query class.
目录锚点:#参数#返回#源码#笔记
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $var | (string) | 必需 | 要检索的变量键。 |
| $default | (mixed) | 可选 | 如果未设置查询变量,则返回的值。 |
返回(Return)
(mixed)查询变量的内容。
源码(Source)
/**
* Retrieve variable in the WP_Query class.
*
* @since 1.5.0
*
* @global WP_Query $wp_query
*
* @param string $var The variable key to retrieve.
* @param mixed $default Value to return if the query variable is not set. Default ''.
* @return mixed
*/
function get_query_var( $var, $default = '' ) {
global $wp_query;
return $wp_query->get( $var, $default );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.9.0 | wp-includes/query.php:26 | 31 | 1 function |
笔记(Notes)
获取当前页码
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!