退房WP::parse_request()
- 不幸的是,它从未真正为公众使用而设计。你可以试试这个,但不确定后果如何:
global $wp,
$wp_the_query;
// Grab the request_uri component of the referer URL.
if ( ! $url = parse_url( $_GET[\'my_referer_parameter\'] ) )
return \'Oh dear, poorly formed referer.\';
// Ewww! Trick WP::parse_request by spoofing REQUEST_URI.
$_SERVER[\'REQUEST_URI\'] = $url[\'path\'] . "?{$url[\'query\']}";
$wp->parse_request();
$wp->query_posts();
// $wp_the_query should now be populated with posts queried by your referer.
while ( $wp_the_query->have_posts() ) {
$wp_the_query->the_post();
the_title();
}