' . __( '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' );
// Used in the HTML title tag.
/* 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'] ) ) :
$message = '';
$type = 'error';
switch ( $_GET['update'] ) {
case 'adduser':
$type = 'success';
$message = __( 'User added.' );
break;
case 'err_add_member':
$message = __( 'User is already a member of this site.' );
break;
case 'err_add_fail':
$message = __( 'User could not be added to this site.' );
break;
case 'err_add_notfound':
$message = __( 'Enter the username of an existing user.' );
break;
case 'promote':
$type = 'success';
$message = __( 'Changed roles.' );
break;
case 'err_promote':
$message = __( 'Select a user to change role.' );
break;
case 'remove':
$type = 'success';
$message = __( 'User removed from this site.' );
break;
case 'err_remove':
$message = __( 'Select a user to remove.' );
break;
case 'newuser':
$type = 'success';
$message = __( 'User created.' );
break;
case 'err_new':
$message = __( 'Enter the username and email.' );
break;
case 'err_new_dup':
$message = __( 'Duplicated username or email address.' );
break;
}
wp_admin_notice(
$message,
array(
'type' => $type,
'dismissible' => true,
'id' => 'message',
)
);
endif;
?>
views(); ?>