$capa is a PHP expression and will always evaluate to administrator. Use the capability read instead – every role (by default) has this.
Related Posts:
- What action should I hook into when adding roles and capabilities?
- What is valid timing of using current_user_can() and related functions?
- Allow Contributor to change the author of his own post?
- What’s the difference between Role and Meta capabilities; When to use map_meta_cap() filter
- add_menu_page permissions – what am I doing wrong?
- How can I grant capabilities directly to users (not roles) in wp-admin?
- Disable posts, only allow to edit existing pages, not create new ones (create_posts)
- How to get all capabilities of an existing user role
- What exactly is WordPress?
- Menu capability in WordPress
- Does the “promote_users” capability allow someone to create a new admin account?
- current_user_can( ‘edit_post’, $post_id ) does not work for contributer but for administrator
- Add user capability and check against it
- Listing all capabilities in dropdown is returning boolean
- Add Media Upload Capabilities Needed for Custom Role for non-Posts
- add_cap only adding the first two in array
- How can I prevent a writer from being able to edit an article that has been scheduled?
- Check whether user can delete a given post
- How to change menu page capability
- Multiple Authors on Single Post
- Allow unfiltered HTML in titles for low level users?
- Allow users to set a post author
- Unify the roles and caps?
- add_menu_page() for more than one user role
- current_user_can capabilities in the admin not working as expected
- Remove menu items from admin page and limit capabilities
- Filter list of rules based on a capability
- Using author_can() on custom post types in WordPress
- How to show a admin bar menu item only to users with certain capabilities?
- Restricted user capabilities cannot add image
- User capability per post
- How come I see a manage_categories capability but not a manage_tags capability for any users?
- Theme option editing capability problems
- Allow Contributor to edit published post and filter by page id
- Able to edit custom post, but unable to create new custom post when within submenu. What capability is missing?
- Usage of current_user_can()
- Is it wise not to use only meta capabilities for certain basic post types?
- Remove capability from specific user
- What capabilities are assigned to unauthenticated users?
- Capabilities Not Changing
- Assign multiple roles , overlapping capabilities
- Administrator role capabilities
- How to get all capabilities
- Prevent all users from editing posts except admins using hooks
- WordPress remove capability post ,media completely for custom role
- Add capability to “Editor” role to be able to view all users attachments
- Why cannot author edit pages?
- Add capability to a role , so user is only able to view his own posts
- how to change capability required to view an admin page? [duplicate]
- How can restrict certain users from delete a category but can view only in wordpress?
- Delete admin edit/delete links in users list wordpress admin
- Create a Capability category to group a few custom Capabilities
- Capability to edit post slugs
- admin can not change author profile picture
- How to add a menu page for options in wordpress for user that has the role of vendor?
- Changing capability type without altering plugin
- Can’t create new Pods pages
- Is there a way of retrieving the core WP capabilities?
- Pricing Tables admin page capability
- Best Roles and Capability on a site with review features using a front end custom post
- Not able to give editors acess to new admin menu item
- Manage Roles and Capabilities on Multi-site
- Force logout when role is changed
- WordPress Remove Submenus
- Reset Roles (or undo role changes on theme change)
- How can I prevent certain custom roles from seeing other custom roles on the user list page?
- Authorize users for specific pages and/or categories
- Conflict between Capabilities and Menu Visibility with Custom Post Types
- WooCommerce which roles and capabilities control user login re-direct to Woo Account Page?
- What’s the correct way to add capabilites to user roles?
- How to handle this specific case of custom post type?
- Show category and tag link as a submenu under custom post type submenu
- same user role or copy the user role to be same as the other role
- Custom capability for a single user
- Roles and Capabilities in Custom Post Types
- Require Capability to View Woocommerce Product
- How can I add/update post meta in a admin menu page?
- How can I check if a visitor can read a post?
- How to query users to count all with a custom capability and limit it to a set of roles?
- do_shortcode() within Admin Page
- Allow comments only for custom post type
- How to make WordPress ‘editor’ role to list/view/add/edit users only with the role ‘author’?
- Create role that can edit some user details, but not the role
- Allow specific user to edit a specific page
- Custom Gutenberg Block and unfiltered_html capability
- How to get data from option page [closed]
- What is more secure checking capabilities of user or checking role of user in WordPress plugin development
- Add Admin menus or submenus depending on conditions
- Cloning admin pages like users.php
- add_role menu pages are not visible
- Users can only save their draft once before saving for revision
- Hide user fields based off capability
- Author capabilities: Deleting comments on their own published posts
- Add capability for editors to modify custom fields
- Capability to read user’s own draft post of CPT
- The menu item is not deleted on WordPress
- No one can edit post/pages by Administrator
- Explanation of User Roles and Capabilities
- How can I display customizer’s “Additional CSS” to administrators and editors (in multisite)?
- Hide comments from admin comments.php that user can’t edit or manage