Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

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

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember General Questions › Execute custom function after registration of a specific level – API or Hooks?

Tagged: Custom, function, hook, registration

  • This topic has 13 replies, 5 voices, and was last updated 5 years, 5 months ago by admin.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • June 27, 2011 at 2:42 am #3664
    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!

    June 27, 2011 at 5:36 am #33713
    amin007
    Participant

    Update: The following action hook can do this now:

    https://www.tipsandtricks-hq.com/wordpress-membership/member-registration-completion-hook-866


    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?

    June 27, 2011 at 12:37 pm #33714
    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.

    June 27, 2011 at 4:55 pm #33715
    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!

    June 28, 2011 at 12:20 am #33716
    amin007
    Participant

    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.

    June 28, 2011 at 3:00 am #33717
    akeith2002
    Member

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

    September 2, 2011 at 10:37 pm #33718
    akeith2002
    Member

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

    September 3, 2011 at 5:09 am #33719
    admin
    Keymaster

    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);

    September 4, 2011 at 7:16 pm #33720
    akeith2002
    Member

    THANK YOU so much

    June 24, 2016 at 3:11 am #33721
    Frank
    Member

    Hey Admin,

    I know that this is an older post, but can you expand on the explanation of the function above?

    Thanks,

    Frank

    June 24, 2016 at 4:24 am #33722
    admin
    Keymaster

    Let me know what you want explained so I know what you are after.

    June 24, 2016 at 3:36 pm #33723
    Frank
    Member

    Hey Admin, I figured it out. I’m just looking at pushing the code I wrote in php into a plugin instead of it hanging off of the back end of the theme’s functions.php file.

    I didn’t realize that it would post my results right on the web page that was posted, thus tell me exactly what I needed to know.

    Frank

    October 10, 2017 at 1:55 pm #33724
    Viviana.cerrutti
    Member

    Hi, is there a similar function to add after a member has updated their profile??? Thanks

    October 10, 2017 at 11:26 pm #33725
    admin
    Keymaster

    We have the following action hook that is triggered after a member updates his profile. You can use it to execute your customer function.

    eMember_profile_updated

    Below is an example snippet of code showing how you can use it:

    add_action('eMember_profile_updated', 'run_my_custom_function', 10, 2);

    function run_my_custom_function($fields, $custom_fields){

    $member_id = $fields['member_id'];
    $username = $fields['username']

    //A member ($username) has updated the profile. Do something...
    }

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ