• I am displaying a list of users who have liked a post/page at the bottom of each page, but it occurred to me that some users may not want all of their favorites (or individual favorites) available to all other users. This would result in fewer favorites by users who are more privacy concerned.

    Is there a way to give the user the option to make their favorites private or public? My first thought is creating custom Yes/No meta data and use this meta data as a parameter when displaying the list of users who have favorited the post using the following code:

    add_filter('simplefavorites_user_list', 'filter_favorites_user_list', 10, 3);
    function filter_favorites_user_list($output, $users, $anonymous_count)
    {
    	$output = '<ul>';
    	foreach($users as $user){
    		$output .= '<li><a href="' . site_url() . '/members/' . $user->user_login . '">' . $user->display_name . '</a></li>';
    	}
    	$output .= '</ul>';
    	$output .= '(+' . $anonymous_count . ' Anonymous Users)';
    	return $output;
    }

    Maybe add a $privacy parameter and only display the users who have selected ‘Yes’ or ‘Public’ for privacy.

    My other idea is to make the user’s favorites private by setting their account settings to the same as the anonymous user type which is already used for all users who are not logged in. This way they could still favorite posts and would be included in the total favorite counts, but they would only show as “Anonymous User” to other members.

    Please let me know if there is a way to implement this privacy feature.
    thx

    https://www.ads-software.com/plugins/favorites/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Allow Logged In Users to Make Their Favorites Private?’ is closed to new replies.