Replies
Viewing 2 posts - 1 through 2 (of 2 total)
Hi Brajesh,
Thanks very much for your reply. I’m glad it’s not obvious, at least!
I have found another way, as follows. Does this look good to you? From what I can tell, it’s ok, but there might be something obviously wrong with it that your experience will quickly spot?
add_action( 'bp_pre_user_query_construct', 'wd_build_exclude_args', 20, 1 ); function wd_build_exclude_args($args) { $excluded = isset( $args->exclude ) ? $args->exclude : array(); $user_ids = get_users( array( 'role__in' => ['subscriber'], 'fields' => 'ID' ) ); $excluded = array_merge( $excluded, $user_ids ); $args->query_vars['exclude'] = $excluded; return $args; }
Thank you!
Jemima
Viewing 2 posts - 1 through 2 (of 2 total)