-
Author
-
June 19, 2016 at 15:14 #125999SitedParticipant
Hi, I’m trying to set Buddypress to friends only.
When I follow the “advice” from Buddypress forum the solutions don;t work on my Kleo installation. I’m assuming this is due to some Kleo customisation or the setup.
I created bp-custom.php and put in Plugins root.
WQith this code:
/* BUDDYPRESS – FRIENDS ONLY */
function buddydev_friends_only_activity_args( $args ) {
if( ! bp_is_activity_directory() || ! is_user_logged_in() ) {
return $args;
}
$user_id = get_current_user_id();
$user_ids = friends_get_friend_user_ids( $user_id );
//include users own too?
array_push( $user_ids, $user_id );
$args[‘user_id’] = $user_ids;
//print_r($args);
return $args;
}
add_filter( ‘bp_after_has_activities_parse_args’, ‘buddydev_friends_only_activity_args’ );
/* END CODE */
But site breaks. It’s recent advice with positive responses that it works for others, any advice on how/where I shoudl put this?
Secondly (but related) I need the Friends widget to only display the friends of mine, not the friends of the profile I’m looking at. I changed the bp_current_user_id() to wp-user-id() in the bp-friends-widget.php but it has no effect.
Again I’m not sure if its because Kleo customisations override, and/or whether in Kleo installation I should be putting this code elsewhere.
Hope you can help as these two very simple things are holding back an otherwise awesome site.
Kind regards,
Darren
June 20, 2016 at 18:49 #126091RaduModeratorHi,
Try to move that snippet form bp-custom.php to wp-content/themes/kleo-child/functions.php
For the second follow this : https://buddypress.org/support/topic/display-only-friends-avatar-in-whos-online-widget/
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Plugins questions’ is closed to new topics and replies.