wp ( $query_vars = '' )
参数
  • (string|array) $query_vars Default WP_Query arguments.
    Required:
    Default: (empty)
定义位置
相关方法
wp_diewp_rss
引入
2.0.0
弃用
-

wp: 这个函数是WordPress的主要入口点。它设置环境,初始化WordPress的核心类和函数,并处理用户的请求。

设置WordPress查询。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp( $query_vars = '' ) {
global $wp, $wp_query, $wp_the_query;
$wp->main( $query_vars );
if ( ! isset( $wp_the_query ) ) {
$wp_the_query = $wp_query;
}
}
function wp( $query_vars = '' ) { global $wp, $wp_query, $wp_the_query; $wp->main( $query_vars ); if ( ! isset( $wp_the_query ) ) { $wp_the_query = $wp_query; } }
function wp( $query_vars = '' ) {
	global $wp, $wp_query, $wp_the_query;

	$wp->main( $query_vars );

	if ( ! isset( $wp_the_query ) ) {
		$wp_the_query = $wp_query;
	}
}

常见问题

FAQs
查看更多 >