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
- How to remove/limit Editor accounts privileges, to prevent them from deleting media and pages created by Admin
- If the current user is an administrator or editor
- 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)?
- Remove Ability for Other Users to View Administrator in User List?
- Groups of capabilities: users with multiple roles?
- How to restrict access to uploaded files?
- alphabetically order role drop-down selection in dashboard
- Execute a function when admin changes the user role
- 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?
- Restrict users on multisite WordPress install
- Basic auth WordPress REST API dilemma
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- How to enable the theme editor cap for an editor role?
- WordPress keeps asking for connection information in localhost
- How to remove “Super Admin” from All Users for those that are not a “Super Admin”?
- Return ID of authors who have at least one post
- Front end user meta options for users
- How do I properly format the user_role array?
- How-to Delay The Capability To Publish Posts?
- Redirect after login based on user role (custom login page)
- How can I check if the admin bar is visible to the current user?
- Tagging users in WordPress
- Share user table from WP with Drupal
- Log all users out of all locations after 24 hours
- Get User Role by ID not working
- the_author_meta(‘user_url’, $author->ID) not working properly. how can I solve this?
- add_cap not working with Shop Manager role
- show text If special user is logged
- wordpress editor role remove all but ‘menus’ in appearance menu
- remove/hide pages from users backend
- Roles for Custom Post Types
- Allow user access to Dashboard only!
- Updating wp_user_level on user update
- How to force authors to ‘submit for review’?
- Add a role and give admin priviledges
- Featured image not working, because of custom user role?
- Limit a user to have access to only specified pages?
- 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
- Unique password to access a section site
- 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
- 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
- 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
- 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
- WordPress password as plain text in email
- Redirect Login Based on User Role