Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active April 4, 2022 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/90b58f1e8a72fbc9a78ca3a2fa8df6bf to your computer and use it in GitHub Desktop.
Save KaineLabs/90b58f1e8a72fbc9a78ca3a2fa8df6bf to your computer and use it in GitHub Desktop.
Disable messages for non friends.
<?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