Message Privacy Options
-
Hi there. I think this code ==> is very userful, but, can be better.
How can I add options to choice from Profile / Settings:[√] Everyone (marked by default)
[ ] Only friends// Restrict Private Message to friends. function pp_check_message_recipients( $message_info ) { // Site admins are not restricted if ( is_super_admin() ) return $message_info; $recipients = $message_info->recipients; $friend_ids = friends_get_friend_user_ids( bp_displayed_user_id() ); $nf = 0; foreach ( $recipients as $key => $recipient ) { if ( ! in_array( $recipient->user_id, $friend_ids ) ) $nf++; } // If any recipients are not friends, remove everyone from the recipient's list if ( $nf > 0 ) unset( $message_info->recipients ); return $message_info; } add_action( 'messages_message_before_save', 'pp_check_message_recipients' );
Viewing 4 replies - 1 through 4 (of 4 total)
-
// Restrict Private Message to friends.
Does not work with the new BuddyPress. ;-/
@r-a-y Help please!
Somebody can help?
@shanebp
@modemlooper
@r-a-y
@dcavins
@mercime
@imath
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Message Privacy Options’ is closed to new replies.