Hi Tosin,
Thank you for the suggestion.can you please tell the intent on the request. Do you want new user to be friends with all the feature members or do you want the user who is being featured to be friends with other member matching the criteria?
Regards
BrajeshHi Tosin,
Thank you. I will be getting back to you late this weekend with more details.Regards
BrajeshHi Tosin,
Will it work if we supplied you some code instead.We do plan to change the way the users are selected but that will need some significant time as we hope to have a better maintainable and future adaptable solution for multiple custom sources of users.
If you need a quick solution, Ravi or I can put some code quickly.
Regards
BrajeshHello Tosin,
Please use the following code. It will add all featured members as a friend on new user activation.
add_action( 'bp_core_activated_user', function ( $user_id ) { if ( ! function_exists( 'friends_add_friend' ) ) { return; } $featured_user_ids = get_users( array( 'meta_key' => '_is_featured', 'fields' => 'ID', 'number' => - 1, ) ); if ( empty( $featured_user_ids ) ) { return; } foreach ( $featured_user_ids as $featured_user_id ) { friends_add_friend( $featured_user_id, $user_id, true ); } } );
Please check.
Regards
Ravi
The topic ‘BuddyPress Auto Friendship Pro + BuddyPress Featured Members Feature Suggestion’ is closed to new replies.