Changeset 16050
- Timestamp:
- 10/28/2010 03:46:11 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-app.php
r15471 r16050 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 … … 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; -
trunk/wp-includes/admin-bar/admin-bar-class.php
r16045 r16050 8 8 9 9 function initialize() { 10 global $blog_id;11 12 10 /* Only load super admin menu code if the logged in user is a super admin */ 13 11 if ( is_super_admin() ) { … … 29 27 $this->user->account_domain = $this->user->domain; 30 28 } else { 31 $this->user->active_blog = $this->user->blogs[ $blog_id];29 $this->user->active_blog = $this->user->blogs[get_current_blog_id()]; 32 30 $this->user->domain = trailingslashit( home_url() ); 33 31 $this->user->account_domain = $this->user->domain; … … 86 84 return $this->remove_node( $id, $this->menu ); 87 85 } 88 86 89 87 function render() { 90 88 ?> -
trunk/wp-includes/general-template.php
r15961 r16050 490 490 491 491 return $output; 492 } 493 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); 492 504 } 493 505 -
trunk/wp-includes/post.php
r15973 r16050 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 … … 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 ){ … … 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' ) ) ) … … 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' ); -
trunk/wp-includes/user.php
r16048 r16050 377 377 'blog_id' => $GLOBALS['blog_id'], 378 378 'role' => '', 379 'meta_key' => '', 379 'meta_key' => '', 380 380 'meta_value' => '', 381 381 'meta_compare' => '', … … 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 ) ); … … 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; … … 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();
Note: See TracChangeset
for help on using the changeset viewer.