Hi @technologyrocks
Here’s the code that allows you to add Group to Members:
add_action( 'members_register_cap_groups', 'th_register_cap_groups' );
function th_register_cap_groups() {
members_register_cap_group(
'your_group_name',
array(
'label' => __( 'Your Group Label', 'example-textdomain' ),
'caps' => array(),
'icon' => 'dashicons-admin-generic',
'priority' => 10
)
);
}
and here is the code to add custom capabilities:
add_action( 'members_register_caps', 'th_register_caps' );
function th_register_caps() {
members_register_cap(
'your_cap_name',
array(
'label' => __( 'Your Capability Label', 'example-textdomain' ),
'group' => 'example'
)
);
}
however, implementing this capability will require custom coding.
Cheers
Hi, for anyone else who needs this, I found that Flamingo is assigned the edit_users capability.
In Members, grant edit_users in the custom role and hey presto! Flamingo shows in the custom role (and no user menu if Edit Users is the only capability granted).
This opens up a security hole, as this custom role should not have access to users. Therefore, I also added the following to my functions.php, where ‘cattery-admin’ is the name of the custom role:
add_action( 'load-user-edit.php', 'post_listing_page' );
function post_listing_page() {
$user = wp_get_current_user();
if ( $user->roles[0] == 'cattery_admin' ) {
wp_redirect( site_url('/'));
exit;
}
}