Skip to content

Instantly share code, notes, and snippets.

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/9ff352596bb247cf158e535b99af5230 to your computer and use it in GitHub Desktop.
Save KaineLabs/9ff352596bb247cf158e535b99af5230 to your computer and use it in GitHub Desktop.
Hide Private Profiles From Friends Suggestions
<?php
/**
* Hide Private Profiles From Friends Suggestions.
*/
function yzc_hide_private_profile_from_friends_suggestions( $friends_of_friends = null ) {
if ( ! empty( $friends_of_friends ) ) {
foreach ( $friends_of_friends as $key => $friend_id ) {
if ( get_the_author_meta( 'yz_enable_private_account', $friend_id ) == 'on' ) {
unset( $friends_of_friends[ $key ] );
}
}
}
return $friends_of_friends;
}
add_filter( 'yz_friends_get_friend_user_ids', 'yzc_hide_private_profile_from_friends_suggestions' );
add_filter( 'yz_friends_suggestions_friends_of_friends', 'yzc_hide_private_profile_from_friends_suggestions' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment