latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

which hook should I use to custom registratio

Home Forums Community Forum which hook should I use to custom registratio

This topic contains 8 replies, has 3 voices. Last updated by  Raam Dev 4 years, 10 months ago.

Topic Author Topic
Posted: Tuesday Feb 28th, 2012 at 9:15 pm #6698
Lan
Username: bigrice

Hello Jason/expert,
I wish to insert some customized php codes to s2member. I want these php codes to be called after the user clicks the “submission” button on the registration form. can you please let me know which s2member hook I should use?

Thank you very much in advance

  • This topic was modified 4 years, 10 months ago by  Lan.
  • This topic was modified 4 years, 10 months ago by  Lan.

List Of Topic Replies

Viewing 8 replies - 1 through 8 (of 8 total)
Author Replies
Author Replies
Posted: Wednesday Feb 29th, 2012 at 12:38 pm #6773
Raam Dev
Username: Raam
Staff Member

Hi Lan,

Please see s2Member Registration hooks. It sounds like the ws_plugin__s2member_after_register hook should work for you.

Posted: Wednesday Feb 29th, 2012 at 10:25 pm #6845
Lan
Username: bigrice

Thank you very much, man!

Posted: Wednesday Feb 29th, 2012 at 11:53 pm #6859
Lan
Username: bigrice

Oops, I put in that hook, however got an error message saying

Warning: Cannot modify header information – headers already sent by …/s2-hacks.php:2) in ../wp-login.php on line 349

How can I fix that error?
Thank you for your advice

Posted: Thursday Mar 1st, 2012 at 10:30 am #6897
Raam Dev
Username: Raam
Staff Member

Hi Lan,

It sounds like your custom code is attempting to modify header information (such as when doing a redirect using the header() function). You’ll need to fix your code to stop that from happening.

Posted: Friday Mar 2nd, 2012 at 5:43 pm #7109

Lan, please make sure you have no spaces or newlines outside of the PHP block. The file should start with [hilite pre_code][/hilite]

Posted: Saturday Mar 3rd, 2012 at 9:28 am #7163
Lan
Username: bigrice

Wooo, Cris, thank you very much for helping reply my kindergarten level question… it works!!
However, I did not see the echo message “My Hook works.” after the registration.
How can I print the message out after the user registration?

Sorry for asking another stupid question….just to try to learn a few basics here…did not mean to ask you to code for me…..thank you very much in advance.

Posted: Saturday Mar 3rd, 2012 at 9:38 am #7165
Lan
Username: bigrice

here is the code i used

<?php
add_action('ws_plugin__s2member_after_register', 'my_action_hook_function');
 function my_action_hook_function($vars = array()) { echo "My Hook works."; print_r($vars); } ?>
Posted: Tuesday Mar 6th, 2012 at 12:14 pm #7466
Raam Dev
Username: Raam
Staff Member

Hi Lan,

You may want to ask these kinds of questions over on the WordPress.org Support Forums. We cannot assist with custom coding.

Please read our Support Policy for further details in this regard. Again, I’m very sorry.
s2Member® » Support Policy » Fine Lines

Viewing 8 replies - 1 through 8 (of 8 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.