<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[55878] trunk/src/wp-admin/users.php: Coding Standards: Use strict comparison in `wp-admin/users.php`.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/55878">55878</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/55878","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-06-04 02:33:32 +0000 (Sun, 04 Jun 2023)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Coding Standards: Use strict comparison in `wp-admin/users.php`.
Includes minor code layout fixes for better readability.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/3061">[3061]</a>, <a href="https://core.trac.wordpress.org/changeset/31941">[31941]</a>, <a href="https://core.trac.wordpress.org/changeset/47848">[47848]</a>, <a href="https://core.trac.wordpress.org/changeset/55622">[55622]</a>, <a href="https://core.trac.wordpress.org/changeset/55623">[55623]</a>.
Props aristath, poena, afercia, SergeyBiryukov.
See <a href="https://core.trac.wordpress.org/ticket/57839">#57839</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminusersphp">trunk/src/wp-admin/users.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminusersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/users.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/users.php 2023-06-03 16:16:55 UTC (rev 55877)
+++ trunk/src/wp-admin/users.php 2023-06-04 02:33:32 UTC (rev 55878)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,18 +135,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $role = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = $_REQUEST['users'];
- $update = 'promote';
- foreach ( $userids as $id ) {
- $id = (int) $id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array_map( 'intval', (array) $_REQUEST['users'] );
+ $update = 'promote';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $user_ids as $id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'promote_user', $id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The new role of the current user must also have the promote_users cap or be a multisite super admin.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $id === $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' )
- && ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $id === $current_user->ID
+ && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' )
+ && ! ( is_multisite() && current_user_can( 'manage_network_users' ) )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $update = 'err_admin_role';
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,10 +180,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = array_map( 'intval', (array) $_REQUEST['users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array_map( 'intval', (array) $_REQUEST['users'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_REQUEST['delete_option'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = self_admin_url( 'users.php?action=delete&users[]=' . implode( '&users[]=', $userids ) . '&error=true' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = self_admin_url( 'users.php?action=delete&users[]=' . implode( '&users[]=', $user_ids ) . '&error=true' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $url = str_replace( '&', '&', wp_nonce_url( $url, 'bulk-users' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_redirect( $url );
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,15 +196,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $update = 'del';
</span><span class="cx" style="display: block; padding: 0 10px"> $delete_count = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $userids as $id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $user_ids as $id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'delete_user', $id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'Sorry, you are not allowed to delete that user.' ), 403 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $id == $current_user->ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $id === $current_user->ID ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $update = 'err_admin_del';
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> switch ( $_REQUEST['delete_option'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'delete':
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -212,6 +214,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $id, $_REQUEST['reassign_user'] );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> ++$delete_count;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,18 +230,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'resetpassword':
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer( 'bulk-users' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'edit_users' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to edit users.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_REQUEST['users'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_redirect( $redirect );
</span><span class="cx" style="display: block; padding: 0 10px"> exit();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = array_map( 'intval', (array) $_REQUEST['users'] );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array_map( 'intval', (array) $_REQUEST['users'] );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $reset_count = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $userids as $id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $user_ids as $id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'edit_user', $id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -282,15 +288,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_REQUEST['users'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = array( (int) $_REQUEST['user'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array( (int) $_REQUEST['user'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = array_map( 'intval', (array) $_REQUEST['users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array_map( 'intval', (array) $_REQUEST['users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $all_userids = $userids;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $all_user_ids = $user_ids;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $current_user->ID, $userids, true ) ) {
- $userids = array_diff( $userids, array( $current_user->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $current_user->ID, $user_ids, true ) ) {
+ $user_ids = array_diff( $user_ids, array( $current_user->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,14 +306,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $users_have_additional_content Whether the users have additional content. Default false.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int[] $userids Array of IDs for users being deleted.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int[] $user_ids Array of IDs for users being deleted.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $userids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $user_ids );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $userids && ! $users_have_content ) {
- if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $user_ids && ! $users_have_content ) {
+ if ( $wpdb->get_var(
+ "SELECT ID FROM {$wpdb->posts}
+ WHERE post_author IN( " . implode( ',', $user_ids ) . ' )
+ LIMIT 1'
+ ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $users_have_content = true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( $wpdb->get_var(
+ "SELECT link_id FROM {$wpdb->links}
+ WHERE link_owner IN( " . implode( ',', $user_ids ) . ' )
+ LIMIT 1'
+ ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $users_have_content = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,88 +332,119 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/admin-header.php';
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <form method="post" name="updateusers" id="updateusers">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <form method="post" name="updateusers" id="updateusers">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php wp_nonce_field( 'delete-users' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php echo $referer; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div class="wrap">
-<h1><?php _e( 'Delete Users' ); ?></h1>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="wrap">
+ <h1><?php _e( 'Delete Users' ); ?></h1>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php if ( isset( $_REQUEST['error'] ) ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="error">
- <p><strong><?php _e( 'Error:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="error">
+ <p><strong><?php _e( 'Error:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( 1 === count( $all_userids ) ) : ?>
- <p><?php _e( 'You have specified this user for deletion:' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( 1 === count( $all_user_ids ) ) : ?>
+ <p><?php _e( 'You have specified this user for deletion:' ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php else : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <p><?php _e( 'You have specified these users for deletion:' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p><?php _e( 'You have specified these users for deletion:' ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <ul>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> $go_delete = 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $all_userids as $id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ foreach ( $all_user_ids as $id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $id == $current_user->ID ) {
- /* translators: 1: User ID, 2: User login. */
- echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ), $id, $user->user_login ) . "</li>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( $id === $current_user->ID ) {
+ echo '<li>';
+ printf(
+ /* translators: 1: User ID, 2: User login. */
+ __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ),
+ $id,
+ $user->user_login
+ );
+ echo "</li>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: 1: User ID, 2: User login. */
- echo '<li><input type="hidden" name="users[]" value="' . esc_attr( $id ) . '" />' . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<li>';
+ printf(
+ '<input type="hidden" name="users[]" value="%s" />',
+ esc_attr( $id )
+ );
+ printf(
+ /* translators: 1: User ID, 2: User login. */
+ __( 'ID #%1$s: %2$s' ),
+ $id,
+ $user->user_login
+ );
+ echo "</li>\n";
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $go_delete++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </ul>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $go_delete ) :
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $users_have_content ) :
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <input type="hidden" name="delete_option" value="delete" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <input type="hidden" name="delete_option" value="delete" />
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php else : ?>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <fieldset>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php if ( 1 === $go_delete ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
- <?php else : ?>
- <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
- <?php endif; ?>
- <ul style="list-style:none;">
- <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" />
- <?php _e( 'Delete all content.' ); ?></label></li>
- <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
+ <?php else : ?>
+ <p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
+ <?php endif; ?>
+
+ <ul style="list-style:none;">
+ <li>
+ <input type="radio" id="delete_option0" name="delete_option" value="delete" />
+ <label for="delete_option0"><?php _e( 'Delete all content.' ); ?></label>
+ </li>
+ <li>
+ <input type="radio" id="delete_option1" name="delete_option" value="reassign" />
+ <label for="delete_option1"><?php _e( 'Attribute all content to:' ); ?></label>
+ <?php
+ wp_dropdown_users(
+ array(
+ 'name' => 'reassign_user',
+ 'exclude' => $user_ids,
+ 'show' => 'display_name_with_login',
+ )
+ );
+ ?>
+ </li>
+ </ul>
+ </fieldset>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> ';
- wp_dropdown_users(
- array(
- 'name' => 'reassign_user',
- 'exclude' => $userids,
- 'show' => 'display_name_with_login',
- )
- );
- ?>
- </li>
- </ul></fieldset>
- <?php
- endif;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ endif;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires at the end of the delete users form prior to the confirm button.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.0.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.5.0 The `$userids` parameter was added.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.5.0 The `$user_ids` parameter was added.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_User $current_user WP_User object for the current user.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int[] $userids Array of IDs for users being deleted.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int[] $user_ids Array of IDs for users being deleted.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'delete_user_form', $current_user, $userids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'delete_user_form', $current_user, $user_ids );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <input type="hidden" name="action" value="dodelete" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <input type="hidden" name="action" value="dodelete" />
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php submit_button( __( 'Confirm Deletion' ), 'primary' ); ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php else : ?>
- <p><?php _e( 'There are no valid users selected for deletion.' ); ?></p>
- <?php endif; ?>
- </div>
- </form>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ <?php else : ?>
+
+ <p><?php _e( 'There are no valid users selected for deletion.' ); ?></p>
+
+ <?php endif; ?>
+ </div><!-- .wrap -->
+ </form><!-- #updateusers -->
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -420,15 +465,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = $_REQUEST['users'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array_map( 'intval', (array) $_REQUEST['users'] );
+ $update = 'remove';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $update = 'remove';
- foreach ( $userids as $id ) {
- $id = (int) $id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $user_ids as $id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'remove_user', $id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $update = 'err_admin_remove';
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_user_from_blog( $id, $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -453,51 +498,74 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_REQUEST['users'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = array( (int) $_REQUEST['user'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array( (int) $_REQUEST['user'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = $_REQUEST['users'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array_map( 'intval', (array) $_REQUEST['users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/admin-header.php';
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <form method="post" name="updateusers" id="updateusers">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <form method="post" name="updateusers" id="updateusers">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php wp_nonce_field( 'remove-users' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php echo $referer; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div class="wrap">
-<h1><?php _e( 'Remove Users from Site' ); ?></h1>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="wrap">
+ <h1><?php _e( 'Remove Users from Site' ); ?></h1>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( 1 === count( $userids ) ) : ?>
- <p><?php _e( 'You have specified this user for removal:' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( 1 === count( $user_ids ) ) : ?>
+ <p><?php _e( 'You have specified this user for removal:' ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php else : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <p><?php _e( 'You have specified these users for removal:' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p><?php _e( 'You have specified these users for removal:' ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <ul>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> $go_remove = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $userids as $id ) {
- $id = (int) $id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ foreach ( $user_ids as $id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $id );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'remove_user', $id ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: 1: User ID, 2: User login. */
- echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>Sorry, you are not allowed to remove this user.</strong>' ), $id, $user->user_login ) . "</li>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<li>';
+ printf(
+ /* translators: 1: User ID, 2: User login. */
+ __( 'ID #%1$s: %2$s <strong>Sorry, you are not allowed to remove this user.</strong>' ),
+ $id,
+ $user->user_login
+ );
+ echo "</li>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: 1: User ID, 2: User login. */
- echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<li>';
+ printf(
+ '<input type="hidden" name="users[]" value="%s" />',
+ esc_attr( $id )
+ );
+ printf(
+ /* translators: 1: User ID, 2: User login. */
+ __( 'ID #%1$s: %2$s' ),
+ $id,
+ $user->user_login
+ );
+ echo "</li>\n";
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $go_remove = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </ul>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php if ( $go_remove ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <input type="hidden" name="action" value="doremove" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ <input type="hidden" name="action" value="doremove" />
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php submit_button( __( 'Confirm Removal' ), 'primary' ); ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php else : ?>
- <p><?php _e( 'There are no valid users selected for removal.' ); ?></p>
- <?php endif; ?>
- </div>
- </form>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ <?php else : ?>
+
+ <p><?php _e( 'There are no valid users selected for removal.' ); ?></p>
+
+ <?php endif; ?>
+ </div><!-- .wrap -->
+ </form><!-- #updateusers -->
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -511,10 +579,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $wp_list_table->current_action() && ! empty( $_REQUEST['users'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = get_current_screen()->id;
</span><span class="cx" style="display: block; padding: 0 10px"> $sendback = wp_get_referer();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $userids = $_REQUEST['users'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_ids = array_map( 'intval', (array) $_REQUEST['users'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-admin/edit.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $wp_list_table->current_action(), $userids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $wp_list_table->current_action(), $user_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_safe_redirect( $sendback );
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -522,6 +590,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_list_table->prepare_items();
</span><span class="cx" style="display: block; padding: 0 10px"> $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $pagenum > $total_pages && $total_pages > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_redirect( add_query_arg( 'paged', $total_pages ) );
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -535,7 +604,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> case 'del':
</span><span class="cx" style="display: block; padding: 0 10px"> case 'del_many':
</span><span class="cx" style="display: block; padding: 0 10px"> $delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 1 == $delete_count ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 1 === $delete_count ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $message = __( 'User deleted.' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Number of users. */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -549,7 +618,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $user_id && current_user_can( 'edit_user', $user_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $message .= sprintf(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ' <a href="%s">%s</a>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ' <a href="%1$s">%2$s</a>',
</ins><span class="cx" style="display: block; padding: 0 10px"> esc_url(
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_http_referer',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -596,17 +665,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="error">
- <ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="error">
+ <ul>
+ <?php
+ foreach ( $errors->get_error_messages() as $err ) {
+ echo "<li>$err</li>\n";
+ }
+ ?>
+ </ul>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $errors->get_error_messages() as $err ) {
- echo "<li>$err</li>\n";
- }
- ?>
- </ul>
- </div>
- <?php
- endif;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ endif;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $messages ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $messages as $msg ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -615,50 +684,55 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="wrap">
- <h1 class="wp-heading-inline">
- <?php
- echo esc_html( $title );
- ?>
-</h1>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="wrap">
+ <h1 class="wp-heading-inline">
+ <?php echo esc_html( $title ); ?>
+ </h1>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'create_users' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <a href="<?php echo esc_url( admin_url( 'user-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
-<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
- <a href="<?php echo esc_url( admin_url( 'user-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
- <?php
-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ printf(
+ '<a href="%1$s" class="page-title-action">%2$s</a>',
+ esc_url( admin_url( 'user-new.php' ) ),
+ esc_html_x( 'Add New', 'user' )
+ );
+ } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) {
+ printf(
+ '<a href="%1$s" class="page-title-action">%2$s</a>',
+ esc_url( admin_url( 'user-new.php' ) ),
+ esc_html_x( 'Add Existing', 'user' )
+ );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( strlen( $usersearch ) ) {
- echo '<span class="subtitle">';
- printf(
- /* translators: %s: Search query. */
- __( 'Search results for: %s' ),
- '<strong>' . esc_html( $usersearch ) . '</strong>'
- );
- echo '</span>';
-}
-?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( strlen( $usersearch ) ) {
+ echo '<span class="subtitle">';
+ printf(
+ /* translators: %s: Search query. */
+ __( 'Search results for: %s' ),
+ '<strong>' . esc_html( $usersearch ) . '</strong>'
+ );
+ echo '</span>';
+ }
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<hr class="wp-header-end">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <hr class="wp-header-end">
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php $wp_list_table->views(); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<form method="get">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <form method="get">
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( ! empty( $_REQUEST['role'] ) ) { ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<input type="hidden" name="role" value="<?php echo esc_attr( $_REQUEST['role'] ); ?>" />
-<?php } ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <input type="hidden" name="role" value="<?php echo esc_attr( $_REQUEST['role'] ); ?>" />
+ <?php } ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php $wp_list_table->display(); ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-</form>
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div class="clear"></div>
-</div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </form>
+
+ <div class="clear"></div>
+ </div><!-- .wrap -->
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>