Last active
April 4, 2022 17:05
-
-
Save KaineLabs/90b58f1e8a72fbc9a78ca3a2fa8df6bf to your computer and use it in GitHub Desktop.
Disable messages for non friends.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* # Disable Messages for non friends. | |
*/ | |
function yzc_disable_messages_for_nonfriends( $html ) { | |
if ( ! friends_check_friendship( bp_loggedin_user_id(), youzify_get_context_user_id() ) ) { | |
return false; | |
} | |
return $html; | |
} | |
add_filter('yz_get_send_private_message_button', 'yzc_disable_messages_for_nonfriends' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment