ネクストベータ代表Blog

WEBシステム SI屋の代表のブログです。

*

クラス WP::register_globals()

      2014/11/29

クラス WP::register_globals()

定義ファイル :/blog/wp-includes/class-wp.php 1

 public function register_globals() {
global $wp_query;

// Extract updated query vars back into global namespace.
foreach ( (array) $wp_query->query_vars as $key => $value ) {
$GLOBALS[ $key ] = $value;
}

$GLOBALS['query_string'] = $this->query_string;
$GLOBALS['posts'] = & $wp_query->posts;
$GLOBALS['post'] = isset( $wp_query->post ) ? $wp_query->post : null;
$GLOBALS['request'] = $wp_query->request;

if ( $wp_query->is_single() || $wp_query->is_page() ) {
$GLOBALS['more'] = 1;
$GLOBALS['single'] = 1;
}

if ( $wp_query->is_author() && isset( $wp_query->post ) )
$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
}

 - クラス