bp_get_follower_ids( mixed $args = '' )

Returns a comma separated list of user_ids for a given user’s followers.


This can then be passed directly into the members loop querystring. On failure, returns an integer of zero. Needed when used in a members loop to prevent SQL errors.

Arguments include: ‘user_id’ – The user ID you want to check for followers



(mixed) (Optional) Arguments can be passed as an associative array or as a URL argument string

Default value: ''


(Mixed) Comma-seperated string of user IDs on success. Integer zero on failure.


File: bp-activity/bp-activity-template.php

function bp_get_follower_ids( $args = '' ) {

	$r = wp_parse_args( $args, array(
		'user_id' => bp_displayed_user_id()
	) );

	$ids = implode( ',', (array) bp_get_followers( array( 'user_id' => $r['user_id'] ) ) );

	$ids = empty( $ids ) ? 0 : $ids;

	return apply_filters( 'bp_get_follower_ids', $ids, $r['user_id'] );


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.