The problem turned out to be a form software bbpress interfering in some way with the queries for user permissions. If you find yourself in a similar situation there are a ton of resources on google, some of which may help and some that won’t.
Try uninstalling your plugins (ne-name your plugins folder)
Try re-installing wordpress.
Attempt adding the function in the question to your page, and see if the correct user’s permissions are being requested.
Related Posts:
- Can I create users that have access to *some* other users posts instead of all other users posts?
- Set default page for user account in admin
- Managing Users and Creating Groups [closed]
- Allowing users to edit only their page and nobody else’s
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- Hide Admin Menu for Specific User ID who has administrator Role
- How to customize wp_signon()
- Is there a simple way to manage capabilities per user?
- Hide everything on site for visitors except specific page IDs
- How to disable a specific page for a specific user
- Are User Levels Still Currently Used?
- wordpress user roles are not working
- Displaying different in-page content to cliente/admin
- Fix permissions for users role
- Problem with automatic role change through cron job
- How can I allow an User to publish only 5 posts per month?
- Where are $current_user->allcaps set?
- How do I let contributors edit their posts after being approved once?
- Allow admins to login as other users
- Can I Create a Second Admin Level User Role?
- Does it matter if the very first user, usually Admin, does not have a user ID of 1?
- Groups and subgroups for permission
- WordPress user role with create user capability?
- Update user role for expired membership
- User Permissions on custom post type
- Custom User Role: Can Edit Own Page, Cannot Create New
- 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
- Control Category of each user can post
- Limit user access to installing/configuring a plugin?
- current_user_can() returning true for capability when the user and role do not have the capability
- Editor can create any new user except administrator
- Allow member to have access to custom post type only. Permission to only edit their own posts
- How to allow an user role to create a new user under a role which lower than his level only?
- How to programatically change username (user_login)?
- alphabetically order role drop-down selection in dashboard
- How to let contributors to create a new revision(draft) editing their published posts
- How to hide media uploads by other users in the Media menu?
- Show admin bar only for some USERS roles
- How to check user role without using current_user_can()
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- How to assign capabilities to user NOT to User Role
- How to stop a user from updating the post date
- BuddyPress | Check if user is in current group [closed]
- Return ID of authors who have at least one post
- WordPress edit_user_profile_update update secondary role
- Front end user meta options for users
- How to get the Role Name of the current user? (WordPress)
- set_role has no effect
- WP_User->add_role producing unexpected results
- 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?
- Get User Role by ID not working
- show text If special user is logged
- Upgrade Nightmare – No Posts, Permissions Issues and Can’t Create a new post
- remove/hide pages from users backend
- Error: How to allow the “contributor” to upload media in wordpress
- Restrict access of admin uploads to certain logged-in users?
- Reset Password policy
- Rest api return all users (even without content) to all users
- Is possible to allow user to login with different role?
- How change user type from contributor to author
- Featured image not working, because of custom user role?
- Limit a user to have access to only specified pages?
- Does wordpress support natively the concept of logging-in users? (not admins, but users of the website)
- No user found when using REST API
- How to hide user profile fields based on the role of the viewed user?
- Fix ‘Add Role’ Option not there in wordpress 5.2.2
- Allow Users to Modify Some Values of Assigned WordPress Pods [closed]
- Customising “user ids” and add to ‘user’ panel in the admin area
- How to hide some users to unlogged users [closed]
- List all users and current week entries
- Redirect admin 403 “Cheatin uh?” admin pages
- Unique password to access a section site
- One Click Access To Users Account In WordPress?
- how do I add role and capability after I create a new user
- Get Authors Role
- Editor role can only create/edit/delete users who have one of two roles
- User can’t search himself on rest api
- Find count of WordPress users by role and search string for user name
- Hook into add_user_role and update based on new and removed roles
- fine-grained capabilities for user related capabilities
- Create relationships between users or user roles
- Updated user role inncorrect when using wp_get_current_user()
- How to use url formatter with integer
- In admin manage users page, how can I stop users with certain privileges from editing users with other privileges?
- Show user details only
- throttle/limit a logged in user’s http requests to specific page on a per day basis
- Access level seems to have gone from admin to editor
- post acces for guests / unregistered users only
- What’s the most secure way to grant a user permission to update in a multisite?
- Front end login and page restriction
- Limit roles displayed in users.php depending on custom role
- Creating Custom user type just like custom post
- view and update form only for registered users
- i need to let a user to add a role from a frontend form
- file upload user profile
- How to give different user access to different people?
- Wordpres password as plain text in email