friends_friendship_accepted

  • do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id )

    Source Reference:

    • Component: BuddyPress:: bp-friends
      File: /bp-friends/bp-friends-functions.php :: Trac Source Line: 42
      		if ( !$force_accept ) {
      			// Add the on screen notification
      			bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request' );
      
      			// Send the email notification
      			friends_notification_new_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
      
      			do_action( 'friends_friendship_requested', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
      		} else {
      			do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
      		}
      
      		return true;
      	}
      
      	return false;
      }
      
      function friends_remove_friend( $initiator_userid, $friend_userid ) {
      	global $bp;
      
    • Component: BuddyPress:: bp-friends
      File: /bp-friends/bp-friends-functions.php :: Trac Source Line: 112
      			'action'            => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%1$s and %2$s are now friends', 'buddypress' ), $friend_link, $initiator_link ), $friendship ),
      			'item_id'           => $friendship_id,
      			'secondary_item_id' => $friendship->initiator_user_id,
      			'hide_sitewide'     => true // We've already got the first entry site wide
      		) );
      
      		// Send the email notification
      		friends_notification_accepted_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
      
      		do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
      
      		return true;
      	}
      
      	return false;
      }
      
      function friends_reject_friendship( $friendship_id ) {
      	global $bp;
      

Hook: add_action: friends_friendship_accepted instances (2)

  • add_action( 'friends_friendship_accepted', 'friends_clear_friend_object_cache' )
    $function_to_add: friends_clear_friend_object_cache
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: BuddyPress :: bp-friends
      File: /bp-friends/bp-friends-cache.php :: Trac Source Line: 29
      function friends_clear_friend_notifications() {
      	global $bp;
      
      	if ( isset( $_GET['new'] ) )
      		bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_accepted' );
      }
      add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
      
      // List actions to clear object caches on
      

Hook: add_action: friends_friendship_accepted instances (2)

  • add_action( 'friends_friendship_accepted',  'bp_core_clear_cache' )
    $function_to_add: bp_core_clear_cache
    $priority: 0
    $accepted_args: 0

    Source Reference:

Comments are closed.