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.

Allow user registration without email

  1. Hi, I'm building an anonymous site and would like for users to register without providing an email. I know that wp_create_user doesn't require an email address. How can I use the Gravity Forms User Registration Add On without requiring that the user provide an email address? I'm very comfortable modifying PHP code or creating a hook if that's what's required.

    Thanks!

    Posted 11 years ago on Thursday December 27, 2012 | Permalink
  2. I figured out a work around. I made the email field of the registration form visible to the admin only, checked off the "allow field to be populated dynamically" field, and set it to use a parameter called "email." I then added the following code to functions.php to to use a random email address for each new user that is completely hidden from them:

    add_filter("gform_field_value_email", "populate_email");
    function populate_email($value)
    {
    	return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 8) . '@domain.com';
    }

    where "@domain.com" was the actual domain for the site I'm building. This gets the job done. If anyone has a better approach I'm open to it.

    Posted 11 years ago on Thursday December 27, 2012 | Permalink
  3. That's not a bad work around. I'll leave the topic open in case anyone has any other suggestions.

    Posted 11 years ago on Friday December 28, 2012 | Permalink