Last active
April 14, 2020 02:35
-
-
Save KaineLabs/9ff352596bb247cf158e535b99af5230 to your computer and use it in GitHub Desktop.
Hide Private Profiles From Friends Suggestions
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 | |
/** | |
* 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