Ticket #31945: 31945.diff
File 31945.diff, 3.8 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/user.php
diff --git wp-admin/includes/user.php wp-admin/includes/user.php index bcf1362..5a10b80 100644
function default_password_nag() { 440 440 printf( '<a href="%s" id="default-password-nag-no">' . __('No thanks, do not remind me again') . '</a>', '?default_password_nag=0' ); 441 441 echo '</p></div>'; 442 442 } 443 444 /** 445 * Gets the counts of content that will be affected by a user deletion. 446 * 447 * @param array $userids List of user ids being deleted. 448 * @param int $blogid Blog id if using multi-site 449 * 450 * @return string HTML Content 451 */ 452 function wp_affected_delete_user_counts( $userids = array(), $blogid = 0 ) { 453 if( is_multisite() && ! empty( $blogid ) ){ 454 switch_to_blog( intval( $blogid ) ); 455 } 456 457 if ( ! is_array( $userids ) ) { 458 // Puts 459 $userids = array( $userids ); 460 } 461 462 if ( ! is_array( $userids ) ) { 463 print_r( $userids ); 464 return false; 465 } 466 467 // Typecast all to integer. 468 $userids = array_map( 'intval', $userids ); 469 470 $affected_content = ''; 471 foreach( get_post_types( '', 'objects' ) as $post_type ) { 472 $affected_count = 0; 473 foreach ( $userids as $userid ) { 474 if ( empty( $userid ) ) { 475 continue; 476 } 477 $affected_count += count_user_posts( $userid, $post_type->name ); 478 } 479 480 if ( isset( $post_type->labels ) && isset( $post_type->labels->name ) ) { 481 $affected_content .= "<p>{$post_type->labels->name}: $affected_count</p>"; 482 } 483 } 484 485 $output = "<p><strong>"; 486 if ( '' != $affected_content ) { 487 $output .= __( "Affected Content" ); 488 } else { 489 $output .= __( "No content will be affected." ); 490 } 491 $output .= "</strong></p>"; 492 $output .= $affected_content; 493 494 if ( is_multisite() && ! empty( $blogid ) ) { 495 restore_current_blog(); 496 } 497 498 return $output; 499 500 } -
wp-admin/network/users.php
diff --git wp-admin/network/users.php wp-admin/network/users.php index 86a4d74..f4fb7b7 100644
function confirm_delete_users( $users ) { 70 70 <?php echo __( 'Attribute all content to:' ) . '</label>' . $user_dropdown; ?></li> 71 71 </ul> 72 72 <?php 73 74 echo wp_affected_delete_user_counts( $user_id, $details->userblog_id ); 73 75 } 76 77 74 78 } 75 79 echo "</fieldset>"; 76 80 } … … function confirm_delete_users( $users ) { 78 82 } 79 83 80 84 /** This action is documented in wp-admin/users.php */ 81 do_action( 'delete_user_form', $current_user );85 do_action( 'delete_user_form', $current_user, $allusers ); 82 86 83 87 submit_button( __('Confirm Deletion'), 'delete' ); 84 88 ?> -
wp-admin/users.php
diff --git wp-admin/users.php wp-admin/users.php index 64f029c..21862ab 100644
case 'delete': 245 245 wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li> 246 246 </ul></fieldset> 247 247 <?php 248 249 echo wp_affected_delete_user_counts( $userids ); 250 248 251 /** 249 252 * Fires at the end of the delete users form prior to the confirm button. 250 253 * 251 254 * @since 4.0.0 252 255 * 253 * @param WP_User $current_user WP_User object for the user being deleted. 256 * @param WP_User $current_user WP_User object currently logged in user. 257 * @param array $userids List of user ids currently being deleted. 254 258 */ 255 do_action( 'delete_user_form', $current_user );259 do_action( 'delete_user_form', $current_user, $userids ); 256 260 ?> 257 261 <input type="hidden" name="action" value="dodelete" /> 258 262 <?php submit_button( __('Confirm Deletion'), 'secondary' ); ?> -
wp-includes/post.php
diff --git wp-includes/post.php wp-includes/post.php index c8963e6..2f06551 100644
function get_posts_by_author_sql( $post_type, $full = true, $post_author = null, 5297 5297 } // else none 5298 5298 } 5299 5299 5300 if ( 'attachment' == $post_type ) { 5301 $sql .= " OR post_status = 'inherit'"; 5302 } 5303 5300 5304 $sql .= ')'; 5301 5305 5302 5306 return $sql;