BP_Activity_Follow::bulk_check_follow_status( array $leader_ids, int $user_id = false )
Bulk check the follow status for a user against a list of user IDs.
Description
Parameters
- $leader_ids
-
(array) (Required) The user IDs to check the follow status for.
- $user_id
-
(int) (Optional) The user ID to check against the list of leader IDs.
Default value: false
Return
(array)
Source
File: bp-activity/classes/class-bp-activity-follow.php
public static function bulk_check_follow_status( $leader_ids, $user_id = false ) { global $bp, $wpdb; if ( empty( $user_id ) ) { $user_id = bp_loggedin_user_id(); } if ( empty( $user_id ) ) { return false; } $leader_ids = implode( ',', wp_parse_id_list( (array) $leader_ids ) ); return $wpdb->get_results( $wpdb->prepare( "SELECT leader_id, id FROM {$bp->activity->table_name_follow} WHERE follower_id = %d AND leader_id IN ($leader_ids)", $user_id ) ); }
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.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.