Additional menu

Get MemberPress today! Start getting paid for the content you create! Get MemberPress Now

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. 

Note: This add-on is available to MemberPress Scale plan members. You can upgrade to the Scale plan if you're subscribed to another plan. To upgrade, click the Change Plan link on your account page.

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.

Was this article helpful?

Related Articles

computer girl

Get MemberPress today!

Start getting paid for the content you create.