Changeset 47173
- Timestamp:
- 02/04/2020 07:34:27 PM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/network/users.php
r47122 r47173 159 159 160 160 if ( ! empty( $_POST['delete'] ) && 'reassign' == $_POST['delete'][ $blogid ][ $id ] ) { 161 remove_user_from_blog( $id, $blogid, $user_id );161 remove_user_from_blog( $id, $blogid, (int) $user_id ); 162 162 } else { 163 163 remove_user_from_blog( $id, $blogid ); -
trunk/src/wp-includes/ms-functions.php
r47122 r47173 235 235 * @global wpdb $wpdb WordPress database abstraction object. 236 236 * 237 * @param int 238 * @param int $blog_id ID of the blog you're removing the user from.239 * @param string $reassign Optional. A user to whom to reassign posts.240 * @return true|WP_Error 241 */ 242 function remove_user_from_blog( $user_id, $blog_id = '', $reassign = '') {237 * @param int $user_id ID of the user you're removing. 238 * @param int $blog_id Optional. ID of the blog you're removing the user from. Default 0. 239 * @param int $reassign Optional. ID of the user to whom to reassign posts. Default 0. 240 * @return true|WP_Error True on success or a WP_Error object if the user doesn't exist. 241 */ 242 function remove_user_from_blog( $user_id, $blog_id = 0, $reassign = 0 ) { 243 243 global $wpdb; 244 244 245 switch_to_blog( $blog_id ); 245 246 $user_id = (int) $user_id; 247 246 248 /** 247 249 * Fires before a user is removed from a site. … … 254 256 do_action( 'remove_user_from_blog', $user_id, $blog_id ); 255 257 256 // If being removed from the primary blog, set a new primary if the user is assigned257 // to multiple blogs.258 // If being removed from the primary blog, set a new primary 259 // if the user is assigned to multiple blogs. 258 260 $primary_blog = get_user_meta( $user_id, 'primary_blog', true ); 259 261 if ( $primary_blog == $blog_id ) { … … 289 291 } 290 292 291 if ( $reassign != '') {293 if ( $reassign ) { 292 294 $reassign = (int) $reassign; 293 295 $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $user_id ) );
Note: See TracChangeset
for help on using the changeset viewer.