Ticket #31945: 31945-clean.diff
File 31945-clean.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..e63e696 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 return false; 464 } 465 466 // Typecast all to integer. 467 $userids = array_map( 'intval', $userids ); 468 469 $affected_content = ''; 470 foreach( get_post_types( '', 'objects' ) as $post_type ) { 471 $affected_count = 0; 472 foreach ( $userids as $userid ) { 473 if ( empty( $userid ) ) { 474 continue; 475 } 476 $affected_count += count_user_posts( $userid, $post_type->name ); 477 } 478 479 if ( isset( $post_type->labels ) && isset( $post_type->labels->name ) ) { 480 $affected_content .= "<p>{$post_type->labels->name}: $affected_count</p>"; 481 } 482 } 483 484 $output = "<p><strong>"; 485 if ( '' != $affected_content ) { 486 $output .= __( "Affected Content" ); 487 } else { 488 $output .= __( "No content will be affected." ); 489 } 490 $output .= "</strong></p>"; 491 $output .= $affected_content; 492 493 if ( is_multisite() && ! empty( $blogid ) ) { 494 restore_current_blog(); 495 } 496 497 return $output; 498 499 } -
wp-admin/network/users.php
diff --git wp-admin/network/users.php wp-admin/network/users.php index 86a4d74..3b07530 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 } 74 76 } 75 77 echo "</fieldset>"; … … function confirm_delete_users( $users ) { 78 80 } 79 81 80 82 /** This action is documented in wp-admin/users.php */ 81 do_action( 'delete_user_form', $current_user );83 do_action( 'delete_user_form', $current_user, $allusers ); 82 84 83 85 submit_button( __('Confirm Deletion'), 'delete' ); 84 86 ?> -
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;