BuddyPress Automatic Friends
Exclude some users from processing (1 post)

  1. wpmirwin
    Posted 3 years ago #


    First, thanks for the plugin. It works well.

    I had to change it a little to exclude some users. The reason why is because I have some users excluded from all BP Activity (i.e. admin users that I don't want showing up as online, or have their activities listed in the activity stream).

    The problem is that with you new logic, these users will never have a last_login because this information is excluded from being written to the DB. The result is that every time they log in, the friend(s) get added.

    To fix this, I just added some logic before the statement below to filter out certain users by user_id.

    if (!( $bp->loggedin_user->id == "1" || $bp->loggedin_user->id == "2" || $bp->loggedin_user->id == "3" || $bp->loggedin_user->id == "4" )) {
    if( ! isset( $last_login ) || empty( $last_login ) )
    skw_bpaf_create_friendships( $bp->loggedin_user->id );


    It would be nice if you could include the option to exclude certain user ids from processing in the admin panel. i.e. just provide a comma separated list of ids.

    .. Anyway, it's just a suggestion.

    Thanks again for the plugin.



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BuddyPress Automatic Friends
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.