Hi,
WE are waiting for your reply.
Please help us.
Thanks
Hi,
It’s compatible. You just use a ‘page’ capability type for your custom post type ‘awl_filter_gallery’. So you plugin users have to grant ‘pages’ capabilities to provide access to it. As ‘pages’ capabilities belong to another post type – WP built-in ‘pages’, URE shows ‘0’ to the right from you custom post type.
You can define your CPT with its own capability type, like ‘awl_gallery’ instead of ‘page’. Then WP will use ‘edit_galleries’, ‘publish_galleries’, etc., look at ‘capability_type’ parameter description at this page for more details.
You may need to add those custom capabilities at least to ‘administrator’ role then.
Hi Vladimir,
Thanks for the reply, that was too helpful.
But we have a submenu page can’t make it capable.
Please see below code, are we doing right?
public function add_awpl_caps() {
$read_filter_page_caps = array(
'read' => true,
'filter_submenu_page' => TRUE // this is important for your scope
);
add_role( 'filter', 'Fliter', $read_filter_page_caps );
$roles = new WP_Roles();
$roles->add_cap( 'subscriber', 'filter_submenu_page', TRUE);
}
Looking forward to your reply.
Thanks
Hi,
Code is correct. If you need to save your changes to the database, you have to add ‘use_db’ property change:
$roles = new WP_Roles();
$roles->use_db = true;
$roles->add_cap( 'subscriber', 'filter_submenu_page', TRUE);