BP_Friends_Friendship::get_friendships_by_id( int|string|array $friendship_ids )
Get friendship objects by ID (or an array of IDs).
Description
Parameters
- $friendship_ids
-
(Required) Single friendship ID or comma-separated/array list of friendship IDs.
Return
(array)
Source
File: bp-friends/classes/class-bp-friends-friendship.php
public static function get_friendships_by_id( $friendship_ids ) {
global $wpdb;
$bp = buddypress();
$friendship_ids = implode( ',', wp_parse_id_list( $friendship_ids ) );
return $wpdb->get_results( "SELECT * FROM {$bp->friends->table_name} WHERE id IN ({$friendship_ids})" );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.7.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.