Hi Fee – The problem with removing the ‘blog_id’ param is that typically BP users don’t have a role on the root blog. That means that WP_User_Query
will not return them (on multisite).
When you say you “need the default behavior”, is this for a custom setup? If so, how about using the ‘pre_get_users’ action? If this is too general, I can put in another filter, though it’s generally better to use the filters that already exist.
Thread Starter
Fee
(@wdfee)
Hi Boone, you’re right, the ‘pre_get_users’ action got it.
Yes, I’m using multi network, I wrote another action hook to add a role to the BP users. That’s all I need. Thanks!
Hi @fee I would love to know what you did, I am having the same issue … thanks
Thread Starter
Fee
(@wdfee)
Hi Frank, sure – do you mean the hook
// Invite Anyone User Query: only from this network
function my_filter_registered_users_only( $query ) {
$query->query_vars['blog_id'] = get_current_blog_id();
}
add_action( 'pre_get_users', 'my_filter_registered_users_only' );
Hi @fee
that works, thanks