Ticket #43923: 43923.diff
File 43923.diff, 2.4 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/user.php
1015 1015 } 1016 1016 1017 1017 $query = " 1018 SELECT post_status, COUNT( * ) AS num_posts 1019 FROM {$wpdb->posts} 1018 SELECT post_status, COUNT( * ) AS num_posts 1019 FROM {$wpdb->posts} 1020 1020 WHERE post_type = %s 1021 1021 AND post_name = %s 1022 1022 GROUP BY post_status"; … … 1455 1455 $request_id = $item->ID; 1456 1456 $nonce = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id ); 1457 1457 1458 $remove_data_markup = '<div class="remove_personal_data force_remove_personal_data" ' .1458 $remove_data_markup = '<div style="display:inline-block" class="remove_personal_data force_remove_personal_data" ' . 1459 1459 'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' . 1460 1460 'data-request-id="' . esc_attr( $request_id ) . '" ' . 1461 1461 'data-nonce="' . esc_attr( $nonce ) . … … 1467 1467 1468 1468 $remove_data_markup .= '</div>'; 1469 1469 1470 $row_actions = array( 1471 'remove_data' => $remove_data_markup, 1470 $row_actions['remove_data'] = $remove_data_markup; 1471 } 1472 1473 // Give the administrator access to the delete user flow for registered users 1474 $user = get_user_by( 'email', $item->email ); 1475 if ( $user instanceof WP_User ) { 1476 $delete_user_url = wp_nonce_url( 1477 add_query_arg( 1478 array( 1479 'action' => 'delete', 1480 'user' => $user->ID, 1481 ), 1482 admin_url( 'users.php' ) 1483 ), 1484 'bulk-users' 1472 1485 ); 1486 1487 $delete_user_markup = '<span class="delete"><a href="' . $delete_user_url . '">' . __( 'Delete User' ) . '</a></span>'; 1488 1489 $row_actions['delete_user'] = $delete_user_markup; 1473 1490 } 1474 1491 1475 return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) ); 1492 // Lastly, return the lot with either the email or the email and username as the column content 1493 if ( $user instanceof WP_User ) { 1494 return sprintf( 1495 '<a href="%1$s">%2$s (%3$s)</a> %4$s', 1496 esc_url( 'mailto:' . $item->email ), 1497 $item->email, 1498 $user->user_login, 1499 $this->row_actions( $row_actions ) 1500 ); 1501 } 1502 1503 return sprintf( 1504 '<a href="%1$s">%2$s</a> %3$s', 1505 esc_url( 'mailto:' . $item->email ), 1506 $item->email, 1507 $this->row_actions( $row_actions ) 1508 ); 1476 1509 } 1477 1510 1478 1511 /**