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.

39 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.

      1. Hi Roland, there is a new competititon, a new website and the same problem :( No member_id in signup email or pdb_record when user opens the link. All the other fields are visible and sent and accessible. When I edit (eg. just save) the record in admin form in WP, then it appears to the user in the pdb_record from that moment. Like the php script sets the field somehow protected. The member_id I’ve set as a numeric, read only, but despite any combination possible (I’ve tried whatever, even uninstall PDB and the plugin) it is not accessible to the user until admin resaves the record. Please help. Thanks, Martin

        1. What changes did you make to the example plugin from the article?

        2. No changes made. Used it as a default with member_id in PDB as a numeric field for $id_field.

        3. OK, good…looks like we need to clear the cache after updating the ID. Take a look at the plugin code at line 76, I added a line to clear the cache…tested this and it’s now providing the new ID to the email template.

        4. Great. It’s providing the new Id to the templates. Excellent work! Thanks

  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

Your email address will not be published. Required fields are marked *

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

39 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.

      1. Hi Roland, there is a new competititon, a new website and the same problem :( No member_id in signup email or pdb_record when user opens the link. All the other fields are visible and sent and accessible. When I edit (eg. just save) the record in admin form in WP, then it appears to the user in the pdb_record from that moment. Like the php script sets the field somehow protected. The member_id I’ve set as a numeric, read only, but despite any combination possible (I’ve tried whatever, even uninstall PDB and the plugin) it is not accessible to the user until admin resaves the record. Please help. Thanks, Martin

        1. What changes did you make to the example plugin from the article?

        2. No changes made. Used it as a default with member_id in PDB as a numeric field for $id_field.

        3. OK, good…looks like we need to clear the cache after updating the ID. Take a look at the plugin code at line 76, I added a line to clear the cache…tested this and it’s now providing the new ID to the email template.

        4. Great. It’s providing the new Id to the templates. Excellent work! Thanks

  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

Your email address will not be published. Required fields are marked *

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