Support

Home Forums WP User Integration Do not autopopulate first and last with members (users) add-on

Do not autopopulate first and last with members (users) add-on

Posted: January 25, 2014 at 3:21 pm


Jeffrey Strickler

January 25, 2014 at 3:21 pm

I’m using the Members (Users) Addon so that people are required to be logged in before signing up. It works great and as expected. However, it auto populates their first and last name when registering. I don’t want it to auto populate this information. Is it possible to disable this so they have to type something in?


Dean

January 27, 2014 at 2:26 am

Hi,

Sorry, there is no option to disable that feature. I can add it to our feature request list, though currently most new features are on hold.


Jeffrey Strickler

January 27, 2014 at 6:31 pm

Is there any way to remove it in the code? My client will have parents signing up their children for courses and the usernames will be the parent name.


Sidney Harrell

January 27, 2014 at 7:33 pm

In includes/functions/form_build.php, comment out line 67

$answer = $attendee_number === 1 && ! $answer ? htmlspecialchars( stripslashes( $current_user->first_name ), ENT_QUOTES, 'UTF-8' ) : $answer;

and line 72:

$answer = $attendee_number === 1 && ! $answer ? htmlspecialchars( stripslashes( $current_user->last_name ), ENT_QUOTES, 'UTF-8' ) : $answer;


Jeffrey Strickler

January 28, 2014 at 5:55 am

Thanks for both responses! Is there a way to write this in the sites theme function file? or Do I just have to comment it out each time the plugin is updated? Thanks again Jeff!


Tony

  • Support Staff

January 28, 2014 at 6:27 am

The function that code is within is pluggable so you could use the Custom Files Add-on, copy the whole function (lines 4-264) into the custom_functions.php files and modify it there.

Two things to note using this method.

1. The custom files add-on is NOT a plugin and must be manually uploaded to the wp-content/uploads/espresso/ folder.

2. Although the function is pluggable it is a core function, from time to time this may be modified and updated. These updates will need to be transferred to your custom version in order for Event Espresso to function as expected.


Dean

January 28, 2014 at 6:27 am

Hi Jeff,

Sidney is a code genius! The function you would be editing is a “pluggable” function, meaning you could copy the entire function to a custom plugin, the custom files addon or a file called custom_functions.php located in uploads/espresso (you may need to create this).

The function would then override the default one, so you would not need to change it after every update (but you should monitor it for code changes).

The function CANNOT go in the themes functions.php, plugins load before themes so it wouldn’t work.


Jeffrey Strickler

January 28, 2014 at 6:41 am

You guys are awesome at responding quickly and being thorough. Thanks for the great support!

The support post ‘Do not autopopulate first and last with members (users) add-on’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso