Posted on by

Generating Unique Member IDs for New Registrations

Update 1/16/19: this plugin had to be rewritten to work with versions of Participants Database later than 1.8.0.

I often get questions about how to set up member IDs in Participants Database. It is possible to use the built in “id” or “private_id” fields, but in most cases, you’ll want to be able to generate your member IDs yourself according to your desired format.

I am providing a working example plugin, which you can customize to your purpose, or use it as-is. It just assigns a number as the ID, and whenever a new record comes in, it gives it the next number.

You can change the part that assigns the new ID with your own formula for determining the member ID if you want to use a custom format.

Setting Up the Member ID Field

The member ID field needs to be set up in your Participants Database fields. You can set it as a “text-line” field or “numeric” if you just want consecutive numbers for your IDs. Configure it to be “read only” if you don’t want the user changing it.

The plugin code sets the member ID in the background after the form is submitted so it doesn’t need to be included in the signup form.

The Plugin

I’m including a plugin that sets up a simple member ID field functionality: it starts with 1000 and then every new record added after that gets the next number in the sequence. You can easily adapt this to other kinds of member ID schemes if you know how to do that in php.

Download this plugin by clicking on the filename at the bottom of the code window. It will take you to a page where you can download the zip file. The zip file can be easily installed on your site by using the “Plugins/Add New” item in the admin, then clicking on the “Add New” button at the top of the page.

Be sure to edit the plugin file so that the $id_field variable has the name of your Member ID field.

This plugin will also automatically add a member ID to records that don’t have one when they are updated.

34 thoughts on “Generating Unique Member IDs for New Registrations

  1. Hi Roland,
    many thanks for this plugin! It worked perfectly until some days ago. Plugin still generates member_id, bud no more sends it via e-mail to participant, or notification e-mail to me or shows on the signup thanks screen. I have double checked all I know, with no failure found. Except plugins updates I havent done any change to the configuration or DB. Is there anything I should check and repair?
    Thanks, Martin

    1. Probably you are getting some kind of error on the thanks page. You’ll need to turn plugin debugging on, clear the debugging log, then test the plugin, paying attention to what comes in to the error log when you go to the thanks page after the submission.

  2. hI, rOLAND. HOW ARE YOU? yHIS ARTICLE is really it Im need. Referral way for multilevel or schema of affiliates.
    I ask you, if you have thought about expanding the payment methods, and not only PayPal, by making other plugins, even with cryptocurrencies? I would be the first to buy them or if you like we can have you design them for me, just like the plugin you have from MEMBERS PAYMENTS. NOTIFY ME.

    On the other hand, I want to know if I can create the fields with ACF, in the wordpress registration form and if I could still have access to the data from Participants Database? although I’m going to share the Profile plugin you have anyway. I would like very much to be able to ask you the logic of my business and see if it is possible to develop a plugin that captures the registration of new users and uses the payment gateways plugins installed in wordpress before the new user can register and acquire their new ID. registry. Can I send you the requirements? Thank you very much and I will be attentive. Atte RODOLFO

    1. Hi Rodolfo,

      I’m sorry, I don’t have immediate plans to add more payment processors to the Member Payments plugin.

      For your questions about functionality, I think you would be better served by finding a membership plugin that handles payments, such as Woocommerce Memberships. You can use any payment portal you want with that. There are many other premium membership plugins to choose from.

      Participants Database does not share data with ACF, there isn’t any way to define fields in ACF and use them in Participants Database, they are very different plugins that do not work in the same way at all.

Leave a Reply
You have to agree to the comment policy.

Would you like to be notified of followup comments via e-mail? You can also subscribe without commenting.

34 thoughts on “Generating Unique Member IDs for New Registrations

  1. Hi Roland,
    many thanks for this plugin! It worked perfectly until some days ago. Plugin still generates member_id, bud no more sends it via e-mail to participant, or notification e-mail to me or shows on the signup thanks screen. I have double checked all I know, with no failure found. Except plugins updates I havent done any change to the configuration or DB. Is there anything I should check and repair?
    Thanks, Martin

    1. Probably you are getting some kind of error on the thanks page. You’ll need to turn plugin debugging on, clear the debugging log, then test the plugin, paying attention to what comes in to the error log when you go to the thanks page after the submission.

  2. hI, rOLAND. HOW ARE YOU? yHIS ARTICLE is really it Im need. Referral way for multilevel or schema of affiliates.
    I ask you, if you have thought about expanding the payment methods, and not only PayPal, by making other plugins, even with cryptocurrencies? I would be the first to buy them or if you like we can have you design them for me, just like the plugin you have from MEMBERS PAYMENTS. NOTIFY ME.

    On the other hand, I want to know if I can create the fields with ACF, in the wordpress registration form and if I could still have access to the data from Participants Database? although I’m going to share the Profile plugin you have anyway. I would like very much to be able to ask you the logic of my business and see if it is possible to develop a plugin that captures the registration of new users and uses the payment gateways plugins installed in wordpress before the new user can register and acquire their new ID. registry. Can I send you the requirements? Thank you very much and I will be attentive. Atte RODOLFO

    1. Hi Rodolfo,

      I’m sorry, I don’t have immediate plans to add more payment processors to the Member Payments plugin.

      For your questions about functionality, I think you would be better served by finding a membership plugin that handles payments, such as Woocommerce Memberships. You can use any payment portal you want with that. There are many other premium membership plugins to choose from.

      Participants Database does not share data with ACF, there isn’t any way to define fields in ACF and use them in Participants Database, they are very different plugins that do not work in the same way at all.

Leave a Reply
You have to agree to the comment policy.

Would you like to be notified of followup comments via e-mail? You can also subscribe without commenting.