GC::register_globals()
最后更新于:2021-11-26 07:37:20
GC::register_globals()Set up the GeChiUI Globals.
源文件
文件: gc-includes/class-gc.php
public function register_globals() {
global $gc_query;
// Extract updated query vars back into global namespace.
foreach ( (array) $gc_query->query_vars as $key => $value ) {
$GLOBALS[ $key ] = $value;
}
$GLOBALS['query_string'] = $this->query_string;
$GLOBALS['posts'] = & $gc_query->posts;
$GLOBALS['post'] = isset( $gc_query->post ) ? $gc_query->post : null;
$GLOBALS['request'] = $gc_query->request;
if ( $gc_query->is_single() || $gc_query->is_page() ) {
$GLOBALS['more'] = 1;
$GLOBALS['single'] = 1;
}
if ( $gc_query->is_author() ) {
$GLOBALS['authordata'] = get_userdata( get_queried_object_id() );
}
}