Support

Account

Home Forums Feature Requests Usel Field Multisite

Helping

Usel Field Multisite

  • Would be great if we can choose from where, which site, we select user/s in user field, even better would be if we can specify multiple sites within multisite instal users to choose from…

    there is posibility to specify site id in get_users function, so it would just need small change to existing user field’s code…

  • You can create a filter for this.

    
    add_filter('acf/fields/user/query/name=your_field_name', 'set_user_blog_id', 10, 3);
    function set_user_blog_id($args, $field, $post_id) {
      // set blog id in args
      $args['blog_id'] = 2;
      return $args;
    }
    

    I do not believe that get_users() allows you to get users for more than one blog id from what I can see reading the doc https://codex.wordpress.org/Function_Reference/get_users.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Usel Field Multisite’ is closed to new replies.