Simple Membership Plugin › Forums › Simple Membership Plugin › swpm_front_end_registration_complete_user_data hook
Tagged: hook registration
- This topic has 4 replies, 2 voices, and was last updated 10 years ago by
jojoking.
-
AuthorPosts
-
October 25, 2016 at 4:23 pm #8691
jojoking
ParticipantI’ve added the following code to my child theme’s functions.php.
add_action('swpm_front_end_registration_complete_user_data', 'midnight_baker_after_registration_callback'); function midnight_baker_after_registration_callback ($member_info) { //Do stuff SwpmLog::log_simple_debug("midnight_baker_after_registration_callback",true); //if($member_info->get('alias') === 'Hand in Hand Festival Choir') { wp_insert_term( 'lovely lgbt choir', 'choir', array( 'description' => 'amazing lgbt loveliness', 'color' => '#a2a4a6') ); //} //SwpmLog::log_simple_debug(print_r($member_info), true);//Lets see what info is in this array. }I have the debug log on, and I never get anything logged from this function.
I’m completing registration from the thank you page after a Stripe payment (sandbox).
Any ideas?Thanks
October 25, 2016 at 8:58 pm #8693mbrsolution
ModeratorHi, just one question why have your rem out the code with //?
October 25, 2016 at 9:02 pm #8694jojoking
ParticipantInitially, I wanted to make sure it wasn’t the if{} clause that was preventing writing to my ‘choir’ taxonomy. Then I put in the write to the debug file – this isn’t appearing, so that’s why I think it’s not using the hook
October 27, 2016 at 12:29 am #8696mbrsolution
ModeratorI think the sandbox testing does not work using Stripe. But that is my theory.
October 27, 2016 at 3:32 am #8698jojoking
ParticipantI’ve finally figured this out!
I have two levels of paid registration, Choirs and Delegates (Choir Members). So I opted to have different registration forms using the form builder addon. Problem is, this bypasses most of function regigstration_ui() where the hooks are…
By deactivating the addon, it now passes through my ‘swpm_front_end_registration_complete_user_data’ code.
This is the code in question
public function regigstration_ui($level) { //Trigger the filter to override the registration form (the form builder addon uses this filter) $form = apply_filters('swpm_registration_form_override', '', $level);//The $level value could be empty also so the code handling the filter need to check for it. if (!empty($form)) { //An addon has overridden the registration form. So use that one. return $form; }So for now, I’m going to have to do different registration forms in another way…
-
AuthorPosts
- You must be logged in to reply to this topic.