Changeset 25574
- Timestamp:
- 09/23/2013 05:21:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp.php
r23573 r25574 442 442 * 443 443 * @global string $query_string Query string for the loop. 444 * @global array $posts The found posts. 445 * @global WP_Post|null $post The current post, if available. 446 * @global string $request The SQL statement for the request. 444 447 * @global int $more Only set, if single page or post. 445 448 * @global int $single If single page or post. Only set, if single page or post. 449 * @global WP_User $authordata Only set, if author archive. 446 450 * 447 451 * @since 2.0.0 … … 449 453 function register_globals() { 450 454 global $wp_query; 455 451 456 // Extract updated query vars back into global namespace. 452 foreach ( (array) $wp_query->query_vars as $key => $value ) {453 $GLOBALS[ $key] = $value;457 foreach ( (array) $wp_query->query_vars as $key => $value ) { 458 $GLOBALS[ $key ] = $value; 454 459 } 455 460 456 461 $GLOBALS['query_string'] = $this->query_string; 457 462 $GLOBALS['posts'] = & $wp_query->posts; 458 $GLOBALS['post'] = (isset($wp_query->post)) ? $wp_query->post : null;463 $GLOBALS['post'] = isset( $wp_query->post ) ? $wp_query->post : null; 459 464 $GLOBALS['request'] = $wp_query->request; 460 465 461 if ( is_single() ||is_page() ) {462 $GLOBALS['more'] = 1;466 if ( $wp_query->is_single() || $wp_query->is_page() ) { 467 $GLOBALS['more'] = 1; 463 468 $GLOBALS['single'] = 1; 464 469 } 470 471 if ( $wp_query->is_author() && $wp_query->post ) 472 $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author ); 465 473 } 466 474
Note: See TracChangeset
for help on using the changeset viewer.