Changeset 41661 for trunk/src/wp-includes/ms-functions.php
- Timestamp:
- 10/02/2017 01:43:48 AM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/ms-functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r41617 r41661 35 35 * @since MU (3.0.0) 1.0 36 36 * 37 * @global wpdb $wpdb WordPress database abstraction object.38 *39 37 * @param int $user_id The unique ID of the user 40 38 * @return WP_Site|void The blog object 41 39 */ 42 40 function get_active_blog_for_user( $user_id ) { 43 global $wpdb;44 41 $blogs = get_blogs_of_user( $user_id ); 45 42 if ( empty( $blogs ) ) 46 43 return; 47 44 48 if ( !is_multisite() ) 49 return $blogs[$wpdb->blogid]; 45 if ( ! is_multisite() ) { 46 return $blogs[ get_current_blog_id() ]; 47 } 50 48 51 49 $primary_blog = get_user_meta( $user_id, 'primary_blog', true ); … … 2220 2218 $current_user = wp_get_current_user(); 2221 2219 if ( $blog_id == 0 ) { 2222 $blog_id = $wpdb->blogid;2220 $blog_id = get_current_blog_id(); 2223 2221 } 2224 2222 $local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
Note: See TracChangeset
for help on using the changeset viewer.