• Resolved Fee

    (@wdfee)


    Hi Boone,
    would you mind taking this line out of invite_anyone_invite_query(), group-invites.php line 289: 'blog_id' => NULL,
    I need the default behaviour where only users from the current blog are shown or maybe a filter on the blog_id here.
    I’m not sure why this line is in…
    Thanks!
    Fee

    https://wordpress.org/plugins/invite-anyone/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Boone Gorges

    (@boonebgorges)

    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Invite only users from this blog’ is closed to new replies.