PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Performance Issue with wp_dropdown_users()

  1. Aaron Forgue
    Member

    Just a heads up: Our site has over 600,000 users in Wordpress. When creating a new form in GF, the form_detail.php makes use of the wp_dropdown_users() function to populate the 'Default Post Author' field. As a result, it attempts to load all 600+k users into the field.

    This causes a massive load time and occasionally the page just craps out and won't load at all. When I commented out the use of wp_dropdown_users() in form_detail.php, everything loaded fine.

    This temporary solution will hold us over, but it'd be great if you could take this issue into consideration in future releases.

    Thanks!
    Aaron

    Posted 13 years ago on Tuesday March 29, 2011 | Permalink
  2. Aaron Forgue
    Member

    Actually, now that I look closer we might be able to hook into the filter set up right before that and narrow down the search somehow. I'll try that and report back

    Posted 13 years ago on Tuesday March 29, 2011 | Permalink
  3. Aaron Forgue
    Member

    Alright, the filter worked nicely. Here is what I did:

    function inet_limit_author_dropdown($args) {
        $args['who'] = 'authors';
        return $args;
    }
    add_filter('gform_author_dropdown_args', 'inet_limit_author_dropdown');

    This limits the the drop down to only "authors" instead of all users.

    Posted 13 years ago on Tuesday March 29, 2011 | Permalink
  4. This is an issue that does occur on sites with a very large number of users because by default the Author drop down on the Post Title and Post Body fields lists all users. We created the gform_author_drop_args hook specifically for situations like this.

    I'm not sure if you found it in the documentation, but it is located here:

    http://www.gravityhelp.com/documentation/page/Gform_author_dropdown_args

    Posted 13 years ago on Tuesday March 29, 2011 | Permalink