How to Add Custom Fields to the Add Sub-Account Form
From MemberPress Corporate Accounts version 1.5.25 you can add text and drop-down custom fields to the form used to add sub-accounts. This requires adding a custom code snippet using our mepr-user-signup-fields action hook.
Here is an example of what the code snippet would look like:
add_action('mepr-user-signup-fields', function() {
if( !MeprUtils::is_product_page() ) {
?>
<label>
<span><?php _e('Company Name', 'memberpress-corporate'); ?></span>
<input id="" type="text" name="userdata[mepr_company_name]" />
</label>
<label>
<span><?php _e('Your Salary', 'memberpress-corporate'); ?></span>
<select id="" name="userdata[mepr_your_salary]">
<option value="1-5">1k-5k</option>
<option value="5-10">5k-10k</option>
<option value="11-30">11k-30k</option>
<option value="31-50">31k-50k</option>
<option value="51-90">51k-90k</option>
</select>
</label>
<?php
}
});
You can add custom code snippets using a plugin like WPCode, or if you are using a child theme it can be added to the functions.php file.