Found it!
I was missing one custom capability. To the code above, I added this line:
$rol->add_cap( 'edit_' . $cap[0] );
It gives the capability edit_ctpsinglename. (edit_pb_publicacion).
And now it works just fine.
Hope someone find’s this useful.
Related Posts:
- WordPress custom post type capabilities issue
- Capabilities and Custom Post Types
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- Change the text on the Publish button
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- Row actions for custom post types?
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- Register CPTs using Dashicons for admin menu icon in WP 3.8
- How can I remove the “Add New” button in my custom post type?
- Custom Postype specific changes in admin panel
- re-register custom post type with custom capabilities
- Grouping of CPTs and taxonomies into menu groups in admin
- Organize WordPress site, so it can maintain with huge database
- It’s possible to hide body copy box for a custom post type?
- Show data from one Custom Post Type in another Custom Post Type
- Add a custom text to admin footer in a Custom Post Type page
- Creat new admin url for custom post type
- Custom Field values not Showing in Edit Page of Custom Post Type
- Set thumbnail and title for a post type archive (not post itself!)
- Custom WP_Query doesn’t display all posts
- Conflict between Capabilities and Menu Visibility with Custom Post Types
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- Role capabilities issue
- Create field of Custom Post Types
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Select other roles as custom post authors
- Custom posts of one type have disappeared from admin. Still appear on site [closed]
- How to get the custom post list to admin user edit page?
- Copy order items with metadata between orders – Woocommerce
- Capabilities not working with custom post type
- How to handle this specific case of custom post type?
- Change link for “add new” buttons on custom post type
- Custom Post Type – Portfolio no longer works
- How do I edit the WordPress post.php file?
- Custom Post Type – after disable ‘Add New’, I can’t edit and delete post
- Wp custom post custom capability not working together
- Add data to post edit page, when post is published
- How to limit what Editors see in the admin?
- Multiple wp_editor instances in custom post type using Ajax
- Admin: Get all user for Custom Role
- Questions regarding add_meta_box()
- Custom Post Type not working with Capabilities
- Change Post Meta via AJAX from the posts list table
- Roles and Capabilities in Custom Post Types
- Custom Attachment Type
- custom post type capabilities – needs to be VERY secure
- Sorting custom post types in edit.php : Post disappear
- How to customize `Edit-Post` Screen
- Sort by post word count in admin area
- How to display magic field’s custom write panel in wordpress theme?
- jQuery UI & Admin (Calendar)
- Change ordering of fields of custom post type in admin page
- How to display author details in a custom post type in the wordpress backend?
- Add Content Column to Custom Post Type backend
- How to fix the Post Preview Button (CPT & map_meta_cap)
- Restrict Custom Post Type per role in Dashboard
- Change Text in Admin Panel
- Admin slow on Postlist (over 30k Posts in Database)
- Restrict access to custom post type based on its taxonomy terms
- Hide title field of selected post-types on edit pages
- How can I put content before my custom post type default pages?
- Restrict access only of custom post type with standard capabilities to edit_post
- get_posts() returns empty on custom post type /wp-admin/edit.php
- After inserting new post with wp_insert_post() the post is not visble to WP_Query, but the same WP_Query works for post inserted from wp-admin panel
- Put featured image under post title in admin area
- Why “Mine” is the default view when adding ‘capability_type’ in register_post_type
- list articles in admin showing nested categories or slugs?
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- How to display an admin-notice after custom post type edit modification
- CPT requires manage_options and edit_posts for some reason
- Admin Post Table – Remove Title Edit Link
- Sort custom post column by generated value?
- How to only display all posts to a custom User Role?
- Add Custom Field in Product in WP Admin and send to Order Webhook
- Publishing failed. The response is not a valid JSON response
- Limiting the Number of User Posts to Their Own Posts
- How to overwrite function to display parent page combobox for custom post type in Edit Post Page?
- Allowing custom role user to edit post assigned to them but don’t let them create new custom type post
- Can’t see post status drop down for custom post type
- Custom Post Type Capabilities Singular/Plural
- How do I create a customised table list of a custom post type (in the admin area)?
- Restrict Custom Post Type to One Item
- Multiple useres editing specified content
- How to redirect from wp-admin/edit.php to a frontend page for specific custom post type?
- WooThemes – Vendors / Bookings – Allow Vendors to manage resources
- exclude admin archive edit screen
- Simple Data picker meta box
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- Custom post meta box as a sub form
- How to override post-new.php with custom template
- Capibilities of CPT WordPress
- How can I remove “Add new” button on custom post type
- Group based routing and administration
- Limit Number of Custom Post Type Dashboard
- Capabilities and mapping required for a role to be able to edit other’s posts of a custom type, BUT only be able to edit their own blog posts
- Add filter button to custom post type in admin area
- Remove Custom Capability
- “Trash”, “Draft” and count not showing for custom post type in admin panel
- Edit is changing my custom’s post type parent id