Ticket #15233: 15233.001.diff
File 15233.001.diff, 5.2 KB (added by , 15 years ago) |
---|
-
wp-app.php
387 387 * @since 2.2.0 388 388 */ 389 389 function create_post() { 390 global $ blog_id, $user_ID;390 global $user_ID; 391 391 $this->get_accepted_content_type($this->atom_content_types); 392 392 393 393 $parser = new AtomParser(); … … 419 419 if ( !current_user_can($cap) ) 420 420 $this->auth_required(__('Sorry, you do not have the right to edit/publish new posts.')); 421 421 422 $blog_ID = (int ) $blog_id;422 $blog_ID = get_current_blog_id(); 423 423 $post_status = ($publish) ? 'publish' : 'draft'; 424 424 $post_author = (int) $user_ID; 425 425 $post_title = $entry->title[1]; -
wp-includes/admin-bar/admin-bar-class.php
6 6 var $changed_locale = false; 7 7 8 8 function WP_Admin_Bar() { 9 global $current_user , $blog_id;9 global $current_user; 10 10 11 11 $this->user = new stdClass; 12 12 $this->menu = new stdClass; … … 18 18 $this->user->domain = empty( $this->user->active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) ); 19 19 $this->user->account_domain = $this->user->domain; 20 20 } else { 21 $this->user->active_blog = $this->user->blogs[ $blog_id];21 $this->user->active_blog = $this->user->blogs[get_current_blog_id()]; 22 22 $this->user->domain = trailingslashit( home_url() ); 23 23 $this->user->account_domain = $this->user->domain; 24 24 } … … 71 71 function remove_menu( $id ) { 72 72 return $this->remove_node( $id, $this->menu ); 73 73 } 74 74 75 75 function render() { 76 76 ?> 77 77 <div id="wpadminbar" class="snap_nopreview no-grav"> -
wp-includes/general-template.php
492 492 } 493 493 494 494 /** 495 * Retrieve the current blog id 496 * 497 * @since 3.1.0 498 * 499 * @return int Blog id 500 */ 501 function get_current_blog_id() { 502 global $blog_id; 503 return absint($blog_id); 504 } 505 506 /** 495 507 * Display or retrieve page title for all areas of blog. 496 508 * 497 509 * By default, the page title will display the separator before the page title, -
wp-includes/post.php
1016 1016 * behave like edit_posts. 1017 1017 * - publish_posts - Controls publishing objects of this post type. 1018 1018 * - read_private_posts - Controls whether private objects can be read. 1019 1019 1020 1020 * These four primitive capabilities are checked in core in various locations. 1021 1021 * There are also seven other primitive capabilities which are not referenced 1022 1022 * directly in core, except in map_meta_cap(), which takes the three aforementioned … … 2265 2265 'meta_value' =>'', 'post_type' => 'post', 'post_status' => 'draft, publish, future, pending, private', 2266 2266 'suppress_filters' => true 2267 2267 ); 2268 2268 2269 2269 $r = wp_parse_args( $args, $defaults ); 2270 2270 2271 2271 $results = get_posts( $r ); 2272 2272 2273 2273 // Backward compatibility. Prior to 3.1 expected posts to be returned in array 2274 2274 if ( ARRAY_A == $output ){ 2275 2275 foreach( $results as $key => $result ) { … … 4141 4141 * @return string The date. 4142 4142 */ 4143 4143 function _get_last_post_time( $timezone, $field ) { 4144 global $wpdb , $blog_id;4144 global $wpdb; 4145 4145 4146 4146 if ( !in_array( $field, array( 'date', 'modified' ) ) ) 4147 4147 return false; … … 4152 4152 4153 4153 $post_types = apply_filters( "get_lastpost{$field}_post_types", (array) $post_types ); 4154 4154 4155 $key = "lastpost{$field}: $blog_id:$timezone:" . md5( serialize( $post_types ) );4155 $key = "lastpost{$field}:" . get_current_blog_id() . ":$timezone:" . md5( serialize( $post_types ) ); 4156 4156 4157 4157 $date = wp_cache_get( $key, 'timeinfo' ); 4158 4158 -
wp-includes/user.php
376 376 $this->query_vars = wp_parse_args( $query, array( 377 377 'blog_id' => $GLOBALS['blog_id'], 378 378 'role' => '', 379 'meta_key' => '', 379 'meta_key' => '', 380 380 'meta_value' => '', 381 381 'meta_compare' => '', 382 382 'include' => array(), … … 572 572 * @return array List of users that are part of that Blog ID 573 573 */ 574 574 function get_users_of_blog( $id = '' ) { 575 global $blog_id;576 577 575 if ( empty( $id ) ) 578 $id = (int) $blog_id;576 $id = get_current_blog_id(); 579 577 580 578 return get_users( array( 'blog_id' => $id ) ); 581 579 } … … 593 591 global $wpdb; 594 592 595 593 if ( !is_multisite() ) { 596 global $blog_id;594 $blog_id = get_current_blog_id(); 597 595 $blogs = array(); 598 596 $blogs[ $blog_id ]->userblog_id = $blog_id; 599 597 $blogs[ $blog_id ]->blogname = get_option('blogname'); … … 757 755 * @return array Includes a grand total and an array of counts indexed by role strings. 758 756 */ 759 757 function count_users($strategy = 'time') { 760 global $wpdb, $ blog_id, $wp_roles;758 global $wpdb, $wp_roles; 761 759 762 760 // Initialize 763 $id = (int) $blog_id;761 $id = get_current_blog_id(); 764 762 $blog_prefix = $wpdb->get_blog_prefix($id); 765 763 $result = array(); 766 764