Hi,
Thanks for your previous helps and I’m appreciated about that.
I met an issue about how to disable Private Message Function for specific User Role in the BuddyPress.
For example, I want to disable Private Message Function of “Blogger” in my site, restricting them to send any private messages to anyone else in the system, but they can still receive messages from other users.
I’m wondering that is it possible to do that? Could you give me some code snippets about that?
Thank you very much.
Hi Dandy,
Please install our plugin “BuddyPress Private Message Rate Limiter” and Try the following code in your “bp-custom.php” file. I don’t understand blogger role. Please check appropriate capability reference here
https://codex.wordpress.org/Roles_and_Capabilities
function buddydev_disable_private_messaging_for_blogger( $allowed_count ) { if( current_user_can( 'create_sites' ) ) { //should we change it? //if yes, change for super admin } elseif( current_user_can( 'list_users' ) ) { //site admin or above } elseif( current_user_can( 'publish_pages' ) ) { //editor or above } elseif( current_user_can( 'edit_published_posts' ) ) { } elseif ( current_user_can( 'edit_posts' ) ) { //contributor or above } elseif ( current_user_can( 'read' ) ) { //subscriber or above $allowed_count = 0; } return $allowed_count; } add_filter( 'bp_rate_limit_pm_remaining_count', 'buddydev_disable_private_messaging_for_blogger' );
Thank You
RaviHi Ravi,
Thanks for the quick reply!
I have several “Private” groups established with various nested groups utilized for Learndash courses. Some of the groups are general in nature for as a container for organic customers. Other groups are for students associated with Organizations that each group acts as a “container” to separate one from the other. Some of the groups should be allowed to use the private messaging & group forums, other groups I want to be able to turn off the private messaging and restrict communication to just the group forums (and email for group leaders).
Using the BP Private Message Rate Limiter, could it be adapted to manage this?
Thank you,
TravisHi Travis,
I am assuming that you are using BuddyBoss platform as the private message for groups in only available with it currently.Can you please open a new topic an provide us the following details:-
1. Do you want restrictions for group message tab only?
2. Which role should be able to see the message tab in group(moderators/group admins/members)
3. Or do you simply want to turn on/off the group message based on group?Thank you
Brajesh
You must be logged in to reply to this topic.