' . __( 'One of the selected users is not a member of this site.' ) . '
',
403
);
}
$user = get_userdata( $user_id );
$user->set_role( $role );
}
} else {
$update = 'err_promote';
}
break;
default:
if ( ! isset( $_REQUEST['users'] ) ) {
break;
}
check_admin_referer( 'bulk-users' );
$userids = $_REQUEST['users'];
/** This action is documented in wp-admin/network/site-themes.php */
$referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $userids, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
$update = $action;
break;
}
wp_safe_redirect( add_query_arg( 'update', $update, $referer ) );
exit;
}
restore_current_blog();
if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {
wp_safe_redirect( $referer );
exit;
}
add_screen_option( 'per_page' );
/* translators: %s: Site title. */
$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
/**
* Filters whether to show the Add Existing User form on the Multisite Users screen.
*
* @since 3.1.0
*
* @param bool $bool Whether to show the Add Existing User form. Default true.
*/
if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) {
wp_enqueue_script( 'user-suggest' );
}
require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
|
$id,
'selected' => 'site-users',
)
);
if ( isset( $_GET['update'] ) ) :
switch ( $_GET['update'] ) {
case 'adduser':
echo '
' . __( 'User added.' ) . '
';
break;
case 'err_add_member':
echo '
' . __( 'User is already a member of this site.' ) . '
';
break;
case 'err_add_fail':
echo '
' . __( 'User could not be added to this site.' ) . '
';
break;
case 'err_add_notfound':
echo '
' . __( 'Enter the username of an existing user.' ) . '
';
break;
case 'promote':
echo '
' . __( 'Changed roles.' ) . '
';
break;
case 'err_promote':
echo '
' . __( 'Select a user to change role.' ) . '
';
break;
case 'remove':
echo '
' . __( 'User removed from this site.' ) . '
';
break;
case 'err_remove':
echo '
' . __( 'Select a user to remove.' ) . '
';
break;
case 'newuser':
echo '
' . __( 'User created.' ) . '
';
break;
case 'err_new':
echo '
' . __( 'Enter the username and email.' ) . '
';
break;
case 'err_new_dup':
echo '
' . __( 'Duplicated username or email address.' ) . '
';
break;
}
endif;
?>
views(); ?>