Can’t comment on my own question, so I guess that giving a loose answer is the best and only way to get back to you.
How I’m getting the roles:
$user = get_user_by('login', 'newuser');
$user_meta = get_userdata($user->ID);
$user_roles = $user_meta->roles;
- I do not use any plugin. Fresh WP multisite.
I also tried a small trick to get over this:
if(empty($user_roles)) {
$wp_user_object = new WP_User($user->ID);
$wp_user_object->add_role('editor');
}
But the roles arrays is still empty and I’m not able to login in the subsite with the moved user.
What makes this interesting is that in the subsite’s dashboard you can see that the user is an “Editor”
EDIT:
can’t comment on my own question because this account is used in different stackexchange forum, and I posted this question as an guest. duh
Related Posts:
- Where are available Roles Defined in the wp_ database?
- Why are my roles not visible in a Multi-site/Network?
- Site admin in a network install can’t edit users?
- Troubleshooting a “You do not have sufficient permissions to access this page” error
- Issue with Custom Roles in Multisite
- How to enable a site administrator to edit users in a WordPress network/ multisite setup?
- How can I display all Multisite blogs where this user is administrator?
- Add role across network in multisite
- Restrict users on multisite WordPress install
- Possible to make custom role in multisite that can add sites?
- Prevent user creating new users with specific roles
- WordPress Multisite Layered Admins
- How To Remove Dashboard Menu Items for Multisite Users?
- How to get a user role of a specific blog in multisite?
- Can wp-cli display all users and their roles across all sites in a multisite instance?
- Can simple Admin save options in a Multisite?
- Identical members roles on all sites in a multisite
- WPMU – new users are automatically subscribed to the main blog – how to prevent that?
- create_users capabilities on a role on multisite
- Within the database, where is the flag which says that a user has Super Admin rights?
- Update User Role Across Network when Main Site User is Updated
- Assign role to user on first login, if they are first (after admin)
- Avoid having infinite loops
- Get the User ID Who Owns a Given Blog ID in Multisite
- Create custom role, multisite, add users/sites?
- Make a user administrator to a sub directory site and a contributor to main site in multisite network
- access the plugins for each role in WordPress multisite
- How to change user starting role in WordPress MultiSite?
- Allow Author on Site A capability to upload files on Site B in Multi Site
- Multisite user roles – capabilities not working
- Create Custom Multisite User Role to Reduce Capabilities
- Restrict Capability of Administrator to Create, Edit and Delete Pages in Multisite
- Admin permission for creating blogs in multisite
- Remove superadmin role from the “change role to” menu in user listing
- Copy user role on multisite so the user can access subsites with same role
- How to change a user role after registering in multisite?
- How to sync roles across Multisite?
- Multisite network admin – User’s role not showing up
- WordPress Multisite Add User
- WordPress multisite, allow non super admins to create sites
- WPMU If MU site has no administrator, deactivate site
- Give users acces to admin a single post or set up WP network?
- can’t create user without email for an author after converting single site to multisite
- Easily adding multiple existing users to a multisite site
- Language per user role, how can I achieve this?
- Admin users not able to see network menus
- let user select roles in the wordpress subsites
- Redirect a user roll to a page after login in mutlisite network
- WordPress single sign on using cookies with shared user role functionality between more than 2 wordpress subdomains
- A different role for each site in a multisite
- Multisite error when adding a user: already a member of this site
- How to create child/sub user under parent user
- How create a multisite setup with “phantom” accounts and passwords?
- Multisite vs Role Scoper
- Get users from all/specific blog by user_role and current_user role
- Is there any way to give all users access to one blog in a multisite network without using a plugin?
- How can I display all Multisite blogs where this user is administrator?
- How to give “author” user role appropriate capabilities to add PollDaddy polls? WordPress multisite
- Multisite and users being listed on network administration dashboard and not main site dashboard
- Non-super-admin users cannot access CPT even though I have explicitly added the capabilities to the user role
- How to use WordPress Multisite With Different Domain Names?
- How To Add Custom Form Fields To The User Profile Page?
- restore_current_blog() vs switch_to_blog()
- Can i merge 2 new WP_Query($variable) ‘s?
- How to disable a network enabled plugin for just one site?
- How to reliably flush rewrite rules on multisite?
- Site Redirecting to wp-signup.php
- Moving a WP Multisite to a subdirectory
- Cookies in multisite where network sites have their own domain name
- Convert a Multisite WordPress install into a Single site
- WordPress MultiSite Active Directory integration and site privacy
- WordPress Job Interview Preparation
- How to add Custom Blog Options to new blog setup form?
- How can I trust switch_to_blog()?
- Remove the blog slug from WordPress Multisite root node
- How to use same email for multiple users
- How to run an activation function when plugin is network activated on multisite?
- Specific upload folder for PDFs in custom Post type in WP multisite
- What is the correct way to map multiple domains in a WordPress 4.1 multisite install?
- Where can I find documentation on what characters are allowed in user names and why?
- How to migrate subsite from dev multisite to production multisite
- How can I un-reserve a pending username registration?
- How do I remove/delete an old super admin user?
- DB connection error after copying a WordPress Multisite instance to a second location
- Redirect Main Site to Subsite in Multisite WordPress
- Is there a is_user_logged_in() for multisite?
- Switching MultiSite installation from HTTP to HTTPS
- Allow user to select a theme to install when they signup
- Setting up a wordpress network with third level domains
- Get upload URL by blog ID in multisite
- What’s the difference between get_site_option and get_blog_option?
- Need help sorting “My Sites” Alphabetically
- How to delete post revisions?
- Create mobile site with same content just different theme
- Add additional Network constants to wp-config.php dynamically
- Multisite stuck at 1MB for max file size
- How to get blog name, when using WordPress Multisite
- What are options are there to implement a multi language site
- Switching primary site in WordPress Multisite
- Multisite Network Port Num Issues?