Tips and Tricks HQ Forum

Support Forum for Tips and Tricks HQ Products

Register or log in - lost password? (Having an issue with the forum login?)

Search the Forum

Tips and Tricks HQ Forum » WP eMember » WP eMember General Questions

Execute custom function after registration of a specific level - API or Hooks?

(10 posts) (3 voices)
  • Started 11 months ago by akeith2002
  • Latest reply from Peter
  • Possible Solutions (Related Topics):
    1. Invite Registrations into a Specific Membership Level
    2. Checklist option in Custom Fields for Registration Form
    3. eMember -Domain Level Lockdown - Registration page not accessible via email link
    4. PayPal 'custom payment pages' linked to a specific button?
    5. Membership level editing in registration-form

Tags:

  • Custom
  • function
  • hook
  • member registration redirect
  • registration
  1. akeith2002
    Member

    I am trying to have a post autogenerated everytime a user registers under a specific type. For instance, I have 2 different users, Coaches and Athletes. When an athlete signs up I want to create a post with his name as the title. I already have the Wordpress script created to do that I just need some way of attaching and running it when that specific type of user account is created. Does anyone know how I could do this?

    Thanks!

    Posted 11 months ago #
  2. amin007
    Key Master

    We can add a hook that will get triggered after a registration event and it will pass an array with all the details of the user who just registered. Will that help?

    Posted 11 months ago #
  3. akeith2002
    Member

    wow... why yes I think it will help. Is that something I will just copy and paste in or is it going to be in the next release? if so, when will that be released.

    Thanks!!!!!

    I didn't expect a reply this fast and with someone willing to help me. I appreciate it.

    Posted 11 months ago #
  4. akeith2002
    Member

    I am in the need for some sort of resolution immediately (as all jobs are!). Working on a freelance project and I am a little behind.

    Thanks!

    Posted 11 months ago #
  5. amin007
    Key Master

    I have added a hook for this. You can now add the following code in your plugin or theme's function file to listen for member registration and do something when this even occurs:

    function handle_eMember_registration_complete_event($member_data)
    {
        //The following line will print all the member details that got passed to this function via the $member_data data. You can use this data however you like it.
        print_r($member_data);
    }
    add_action('eMember_registration_complete','handle_eMember_registration_complete_event')

    Everytime a member registers the "handle_eMember_registration_complete_event" function will get triggered and the "$member_data" array will contain all the details of this member.

    Posted 10 months ago #
  6. amin007
    Key Master

    Forgot to mention... You will need a new build of eMember for the above functionality. You can get a new build from here:
    http://support.tipsandtricks-hq.com/update-request

    Posted 10 months ago #
  7. akeith2002
    Member

    I can't express how top notch you guys are!

    Posted 10 months ago #
  8. akeith2002
    Member

    How can I get custom registration fields to show up in the $member_data array?

    Posted 8 months ago #
  9. admin
    Key Master

    I updated this hook to send the custom field data in a separate array. Use the following sample code to find out how it works:

    function handle_eMember_registration_complete_event($member_data,$custom_fields)
    {
        //The following line will print all the member details that got passed to this function via the $member_data array.
        //You can use this data however you like it.
        print_r($member_data);
        echo "<br />Custom fields data shown below<br />";
        print_r($custom_fields);
    }
    add_action('eMember_registration_complete','handle_eMember_registration_complete_event',10,2);

    Get another build of eMember from here to get this update:
    http://support.tipsandtricks-hq.com/update-request

    Posted 8 months ago #
  10. akeith2002
    Member

    THANK YOU so much

    Posted 8 months ago #

RSS feed for this topic

Reply

You must log in to post.

Tips and Tricks HQ  | WP Shopping Cart  | WP Affiliate Software  | WordPress Membership Plugin