来自WordPress源代码:“设置WordPress查询。”(wp包括/functions.php)
wp()方法依次调用wp->main(wp includes/class wp.php),其描述如下:
"Sets up all of the variables required by the WordPress environment.
The action \'wp\' has one parameter that references the WP object. It
allows for accessing the properties and methods to further manipulate the
object."
这似乎是wordpress的“引导”序列。解析url中传递的查询参数,将http标头应用于响应(这包括为pingbacks设置X-pingback标头),设置post查询($wp\\u query和$wp\\u查询变量),如果适用,设置404处理和注册全局变量/常量。
$this->init();
$this->parse_request($query_args);
$this->send_headers();
$this->query_posts();
$this->handle_404();
$this->register_globals();
要获得更多详细信息,请查看每个方法,它们都在wp includes/class wp中。php