Can users be added manually rather than them having to sign-up?

Hello,

I am building a site which uses the Membership plugin, and for the 1st phase of the project new members won't be allowed o sign-up on the site themselves. Instead, admin staff will have to add new users manually on the back-end.

So, 2 questions

1) What is the best way for admin staff to manually add users, keeping in mind that not all users will be added with the same access levels? I can't see an option within the plugin's options to manually add users.

2) We have an existing database of users from the current/soon-to-be-old site which will need to be added to the Membership system in bulk. Can users be added to Membership (again with different access levels) programmatically? Can you please point me towards some documentation or example code?

Many thanks,
Shaun

  • aristath

    Hello there @Shaun, i hope you're well today!

    1) What is the best way for admin staff to manually add users, keeping in mind that not all users will be added with the same access levels? I can't see an option within the plugin's options to manually add users.

    Users can be added from WordPress's "Users" menu, not from inside Membership. You can then manually assign a level to these users from the Membership plugin.

    2) We have an existing database of users from the current/soon-to-be-old site which will need to be added to the Membership system in bulk. Can users be added to Membership (again with different access levels) programmatically? Can you please point me towards some documentation or example code?

    You could use a plugin like this one to import your users: https://wordpress.org/plugins/import-users-from-csv/
    However once they're imported, you will have to manually assign the levels again.

    Cheers,
    Ari.

  • Ash

    Hello @Shaun

    keeping in mind that not all users will be added with the same access levels

    Do you need to assign same level to all users? In that case, create a level and subscription plan and go to Membership > Options > General. From there, select that plan as default for registered users. All registered users will be assigned in that plan.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • Shaun

    Hi,

    I'm well aware of the ability to set a default access level. That's not what I'm looking for.

    As I say, not all users will be added with the same access level. In other words, some users will have 1 access level, some will have another, and some others will have another.

    I need a programmatic solution to update the levels for users. I will add the users to the WordPress installation via a CSV import in a separate process.

    Please indicate how I can programmatically apply access levels to users via a SQL query. Which are the fields controlling access levels that I need to get at?

    Thanks,
    Shaun

  • Hoang Ngo

    Hello @Shaun,

    I hope you are well today.

    Unfortunately this is a extremely complex feature and is beyond the scope of custom coding that we could provide.

    If you need this feature now, you could try posting a job on our job board here https://premium.wpmudev.org/wordpress-development/

    Some note for the development.

    I assume you already have the user id, subscription plan id for the import. So for adding this user_id to the subscription, you can do like this

    $user_id = 1;
    //subscription id
    $sub_id = 1;
    //level id
    $level_id = 1;
    //order id, this is the position of the <strong>level</strong> inside a <strong>subscription plan</strong>, if we don't count the <strong>Starting Point</strong>, it will start from 1
    $order_id=1;
    $model = new Membership_Model_Member($user_id);
    $model->add_subscription($sub_id,$level_id,$order_id);

    Basically, here is a way to add an user to any subscription by code.

    If you have any issues please don't hesitate to let us know so we can assist

    Best regards,
    Hoang Ngo

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.