@lyndysmart
9 years, 1 month ago
Thanks a lot for the explanation @henrywright. I eventually used the following code from http://buddydev.com/buddypress/hiding-users-on-buddypress-based-site/
add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users' ); function buddydev_exclude_users( $args ) { //do not exclude in admin if( is_admin() && ! defined( 'DOING_AJAX' ) ) { return $args; } $excluded = isset( $args['exclude'] )? $args['exclude'] : array(); if( !is_array( $excluded ) ) { $excluded = explode(',', $excluded ); } $user_ids = array( 1,2,3 ); //user ids $excluded = array_merge( $excluded, $user_ids ); $args['exclude'] = $excluded; return $args; }
It worked in hiding users from directories/widgets/friend lists, only that it didn’t also handle profile redirect. I had to set up redirects to homepage for all the admin accounts on server side.
Thanks again for your assistance on this.