Ticket #15854: 15854.diff
| File 15854.diff, 3.4 KB (added by scribu, 2 years ago) |
|---|
-
wp-includes/user.php
619 619 } 620 620 621 621 /** 622 * Get users for the blog.623 *624 * For setups that use the multi-blog feature. Can be used outside of the625 * multi-blog feature.626 *627 * @since 2.2.0628 * @uses get_users() for queries629 * @uses $blog_id The Blog id of the blog for those that use more than one blog630 *631 * @param int $id Blog ID.632 * @return array List of users that are part of that Blog ID633 */634 function get_users_of_blog( $id = '' ) {635 if ( empty( $id ) )636 $id = get_current_blog_id();637 638 return get_users( array( 'blog_id' => $id ) );639 }640 641 /**642 622 * Get the blogs a user belongs to. 643 623 * 644 624 * @since 3.0.0 -
wp-includes/deprecated.php
2416 2416 } 2417 2417 2418 2418 /** 2419 * Get users for the blog. 2420 * 2421 * For setups that use the multi-blog feature. Can be used outside of the 2422 * multi-blog feature. 2423 * 2424 * @since 2.2.0 2425 * @deprecated 3.1.0 2426 * @uses $wpdb WordPress database object for queries 2427 * @uses $blog_id The Blog id of the blog for those that use more than one blog 2428 * 2429 * @param int $id Blog ID. 2430 * @return array List of users that are part of that Blog ID 2431 */ 2432 function get_users_of_blog( $id = '' ) { 2433 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' ); 2434 2435 global $wpdb, $blog_id; 2436 if ( empty($id) ) 2437 $id = (int) $blog_id; 2438 $blog_prefix = $wpdb->get_blog_prefix($id); 2439 $users = $wpdb->get_results( "SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id" ); 2440 return $users; 2441 } 2442 2443 /** 2419 2444 * Enable/disable automatic general feed link outputting. 2420 2445 * 2421 2446 * @since 2.8.0 -
wp-admin/includes/ms.php
65 65 66 66 do_action( 'delete_blog', $blog_id, $drop ); 67 67 68 $users = get_users _of_blog( $blog_id);68 $users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ids' ) ); 69 69 70 70 // Remove users from this blog. 71 71 if ( ! empty( $users ) ) { 72 foreach ( $users as $user ) {73 remove_user_from_blog( $user ->ID, $blog_id) ;72 foreach ( $users as $user_id ) { 73 remove_user_from_blog( $user_id, $blog_id) ; 74 74 } 75 75 } 76 76 -
wp-admin/network/edit.php
52 52 <br /><fieldset><p><legend><?php printf( __( "What should be done with posts and links owned by <em>%s</em>?" ), $delete_user->user_login ); ?></legend></p> 53 53 <?php 54 54 foreach ( (array) $blogs as $key => $details ) { 55 $blog_users = get_users _of_blog( $details->userblog_id);55 $blog_users = get_users( array( 'blog_id' => $details->userblog_id ) ); 56 56 if ( is_array( $blog_users ) && !empty( $blog_users ) ) { 57 57 $user_site = "<a href='" . esc_url( get_home_url( $details->userblog_id ) ) . "'>{$details->blogname}</a>"; 58 58 $user_dropdown = "<select name='blog[$val][{$key}]'>";
