Thank you Tosin.
I am glad the code worked.
1. Yes, It is still possible to send the message. We have only removed the button.
I don’t see any way to completely restrict from receiving. If we use filter ‘bp_activity_do_mentions’ it will disable for all users.
We can use it for disabling mention for the sender though(It won’t send notifications etc, but the user can manually mention and it will appear in the mention stream).
Regards
BrajeshHello Brajesh,
I know and understand that you don’t provide support for 3rd party plugins, but I really need to impose on you for the last time since the code you provided works. I’m stuck will the code you provided work for this plugin https://wordpress.org/plugins/bp-profile-message-ux/
Please I really really need this, I would be very gratefull
Thanks
Hi Tosin,
I will help you. Please allow me a few days to check the plugin.Thank you
BrajeshHi Tosin,
I haven’t been able to use the Message UX plugin yet. I will need a few more days before looking into it.Thank you
BrajeshHello Tosin,
Please check the following code. remove the older code and let me know if it works or not.
function buddydev_is_user_restricted( $user_id ) { // These user's won't be able to send the message. $restricted_user_ids = array( 2, 4766812, 4766806, 4766824, 4766786, 4766838 ); return in_array( $user_id, $restricted_user_ids ); } function buddydev_start_buffering() { if ( ! function_exists( 'bp_profile_messages_ux_init_pro' ) || ! buddydev_is_user_restricted( bp_displayed_user_id() ) ) { return; } ob_start(); } add_action( 'bp_member_header_actions', 'buddydev_start_buffering', 19 ); function buddydev_end_buffering() { if ( ! function_exists( 'bp_profile_messages_ux_init_pro' ) || ! buddydev_is_user_restricted( bp_displayed_user_id() ) ) { return; } ob_get_clean(); } add_action( 'bp_member_header_actions', 'buddydev_end_buffering', 21 );
This will work in legacy.
Regards
Ravi- This reply was modified 5 years, 6 months ago by Ravi.
The topic ‘ [Resolved] How to disable public and private messages for specific users’ is closed to new replies.