WordPress开发者和主题制作者的搜索引擎



get_query_var ›

Since1.5.0
已弃用n/a
get_query_var ( $var, $default = '' )
参数: (2)
  • (string) $var The variable key to retrieve.
    Required: Yes
  • (mixed) $default Optional. Value to return if the query variable is not set. Default empty.
    Required: No
    默认: (empty)
返回:
  • (mixed) Contents of the query variable.
定义在:
文档:
Change Log:
  • 3.9.0

Retrieve variable in the WP_Query class.



源码

function get_query_var( $var, $default = '' ) {
	global $wp_query;
	return $wp_query->get( $var, $default );
}