Support

Account

Home Forums Bug Reports User-Select-Field with many users

Solved

User-Select-Field with many users

  • Hi,
    i have almost 25.000 user and i implementet a Userfield.
    i the field you can only select a user role of 100 users.

    i get the error
    Fatal error: Allowed memory size
    because it loads all users i think and not just the 100 users of the user role…

    can you help me?

  • Just added a Filter for that custom field
    `
    add_filter(‘acf/fields/user/query/name=customfieldname’, ‘acf_refernt_field_filter’, 10, 3);
    function acf_refernt_field_filter( $args, $field, $post )
    {
    // modify get users args of that field
    $args[‘role’] = ‘my-custom-user-role’;

    return $args;
    }
    `

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

The topic ‘User-Select-Field with many users’ is closed to new replies.