It was a simple thing when thinking of it… I needed to add:
$role->add_cap( 'edit_others_pages ' );
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
- 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
- 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?
- 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
- 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
- Add capability to a role , so user is only able to view his own posts
- Plugin page and capabilities
- 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
- 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
- Getting a List of Currently Available Roles on a WordPress Site?
- Editor can create any new user except administrator
- Custom taxonomies capabilities
- Capabilities Vs User Meta
- How can I modify the Capability needed to access a plugin’s options?
- How to enable a site administrator to edit users in a WordPress network/ multisite setup?
- Read only capability for custom post in admin area
- How to update role capabilities
- How do I fix problems with users not being able to publish and only submit for review after upgrade of Multisites installation?
- how to add custom user capabilities using add_user_meta or something else?
- Hooking into add_submenu_page
- Using Custom Meta Capabilities on Custom Post Type
- How to get all users with Author role capabilities?
- Allow Users Access to Custom Post Type Only
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- How to check if a role has a specific capability
- add capability to author role to be able to delete attachments
- Custom Role can’t trash Custom Post Type
- How can I restore admin capabilities?
- What determines whether admin toolbar is shown to a logged-in user?
- Are User Levels Still Currently Used?
- Pending status by default for a specific role
- Is there a capability for managing plugin options?
- upload_files cap to not loggen in users – add_cap to not logged in users
- Sorry, you are not allowed to access this page
- Allow user to only access custom post type
- Restrict Capability of Administrator to Create, Edit and Delete Pages in Multisite
- Unable to delete custom post types, confusion around capabilities
- How can I promote a user to a network administrator?
- Menu page with minimum capability as ‘Subscriber’ doesn’t allow ‘Admin’ to access it?
- What is the name of the user capability to read a reusable block?
- Create sub-administrator role that can do everything except use or see the code editor
- “sufficient permissions” error for admin after duplicating WP database to new install
- Creating a folder structure
- Disabled delete_others_posts if post is from admin
- user_has_cap filter allows “edit_others_posts” but not is not allowing updating/publishing
- How to only display all posts to a custom User Role?
- How to give custom roles the capability to edit one Menu instead of every Menu
- fine-grained capabilities for user related capabilities
- Why user profile update creates Additional Capabilities
- Plugin capabilities
- Custom role, capabilities, and post type: preview button wrecks things
- Grant access to admin menu?