I think you are on the right track, wp_cache_delete
was what finally helped me get an auto-signup with auto-login plugin working… I have this from there:
wp_cache_delete($current_user->ID, 'users');
wp_cache_delete($current_user->user_login, 'userlogins');
Then see what roles you get after that with:
$current_user = wp_get_current_user();
Related Posts:
- Editor can create any new user except administrator
- Remove Ability for Other Users to View Administrator in User List?
- Groups of capabilities: users with multiple roles?
- User-edit role setting distinct from wp_capabilities? [closed]
- How to let contributors to create a new revision(draft) editing their published posts
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- How to check user role without using current_user_can()
- Do not allow users to create new posts and pages
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- How to enable the theme editor cap for an editor role?
- How to assign capabilities to user NOT to User Role
- How-to Delay The Capability To Publish Posts?
- Is there a simple way to manage capabilities per user?
- Get User Role by ID not working
- Getting users by specific capability, not role
- Are User Levels Still Currently Used?
- Remove Capabilities from WP admin for specific user role
- Add a role and give admin priviledges
- Where are $current_user->allcaps set?
- How can I prevent certain custom roles from seeing other custom roles on the user list page?
- What’s the correct way to add capabilites to user roles?
- Can I Create a Second Admin Level User Role?
- Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?
- how do I add role and capability after I create a new user
- How to make WordPress ‘editor’ role to list/view/add/edit users only with the role ‘author’?
- fine-grained capabilities for user related capabilities
- Disabling user capability to edit_posts or delete_posts in the front-end
- Groups roles & capabilities
- Subscriber role – blank page
- current_user_can() returning true for capability when the user and role do not have the capability
- If the current user is an administrator or editor
- Make WooCommerce pages accessible for logged in users only
- Find out if logged in user is not subscriber
- Execute a function when admin changes the user role
- What the user_status column?
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- Hide Admin Menu for Specific User ID who has administrator Role
- Grouping users under parent user
- How to programmatically add a user to a role?
- How to assign an additional/extra/second user-role to multiple users (of a specific user-role)
- How to stop a user from updating the post date
- BuddyPress | Check if user is in current group [closed]
- WordPress edit_user_profile_update update secondary role
- How to customize wp_signon()
- Is it possible to get a user with just the password field?
- How to get the Role Name of the current user? (WordPress)
- set_role has no effect
- WP_User->add_role producing unexpected results
- Users roles, make a page belonging to multiple users
- Redirect after users complete profile form
- How do I list in the backend all users that were assigned to a custom role?
- How to add local users to wordpress without email password?
- How to disable a specific page for a specific user
- How to add a user profile page to frontend?
- Error: How to allow the “contributor” to upload media in wordpress
- wordpress user roles are not working
- Displaying different in-page content to cliente/admin
- User capability for editing their own comments
- What are some best practices for user exit strategy?
- Is there a way to identify a user in a custom REST API method? [duplicate]
- Problem with automatic role change through cron job
- Allow Contributors to Upload Files
- How can I allow an User to publish only 5 posts per month?
- Is possible to allow user to login with different role?
- Allow add new post access to custom post but not wp post for some role
- How do I let contributors edit their posts after being approved once?
- Allow unfiltered HTML for not logged in users when saving a post
- Load user by specific role
- WooCommerce which roles and capabilities control user login re-direct to Woo Account Page?
- Fix ‘Add Role’ Option not there in wordpress 5.2.2
- User roles not displaying
- Allow admins to login as other users
- Allow Users to Modify Some Values of Assigned WordPress Pods [closed]
- Custom capability for a single user
- Change User Role based on Point System Issue
- How do I modify the user role ‘subscriber’ to allow the user to delete posts
- Switch to user link shortcode
- How to hide “Change role to” dropdown on Users admin menu
- hide page menu from admin panel for specific users
- Woocommerce customer role doesn’t change if user is already a subscriber [closed]
- WooThemes – Vendors / Bookings – Allow Vendors to manage resources
- In admin manage users page, how can I stop users with certain privileges from editing users with other privileges?
- User Role not showing in Users Screen
- Custom User Role: Can Edit Own Page, Cannot Create New
- Button for users to upgrade their user role + Button to show current user role!
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- Restrict Access to the User Profile
- How to add a menu page for options in wordpress for user that has the role of vendor?
- How to get only 1 role from user
- User “none” role
- Giving users an editable homepage/business directory
- Want to add post to user dashboard
- Limit user access to installing/configuring a plugin?
- hide woo commerce dashboard status and reports from woo commerce from specific users but display to other users
- No one can edit post/pages by Administrator
- Increase by one the user counter on specific role
- Show only users with the same role in Dashboard user list
- Remove My Account Menu items in Woocommerce based on user roles
- WordPress: New user role which is ONLY allowed to manage media