I want to hide the button to create new discussions within a group and I have managed to do it through the Wordpress roles with the code you see below, but I would like to do it with the role of Buddypress. I want to hide the button for those who have the role of "Members"
These are the roles: https://codex.buddypress.org/administrator-guide/group-settings-and-roles/
Thank you!
add_action( 'wp_enqueue_scripts', 'wholesale_customer_logo' );
function wholesale_customer_logo(){
if( in_array( 'customer', (array) wp_get_current_user()->roles ) || in_array( 'subscriber', (array) wp_get_current_user()->roles ) ){
echo '<style>
.button.btn-new-topic {
display:none!important;}
</style>';
}
}
Tried with in_array( 'member', (array) wp_get_current_user()->roles )
but it doesn't work.