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.

Hooks example to save derived field data.

Home Forums Community Forum Hooks example to save derived field data.

This topic contains 1 reply, has 2 voices. Last updated by  David Welch 4 years, 10 months ago.

Topic Author Topic
Posted: Monday Mar 12th, 2012 at 6:56 pm #7930
Ian Henghes
Username: iaeon

I am looking to derive some data when users register and save the results in additional profile fields. For example I would like to make a call to the mapit.mysociety.org API to get an ‘area’ from a UK postcode and save this information in another field when a user registers or updates their profile.

Is there any example code somewhere to show how this might work? Any code (I imagine using ‘hooks’) that intercepts the ‘update’ table command and performs some additional action to modify the database query would be ideal. Failiing this anyone like to advise on the principals involved and where to look to figure it out?

Shame it is not possible to register on the old forum and search there as there may be answers lurking out of view… Searches here are not returning much of use as yet.

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Tuesday Mar 13th, 2012 at 3:27 pm #8034
David Welch
Username: dwbiz05

You might try this:

function dw_user_registration_stats($user_id){
	//Your functions that need to run.
}

add_action("ws_plugin__s2member_after_configure_user_registration","dw_user_registration_stats");

This hook should run after s2member has finished all of it’s membership option settings and before the registration is completed.

Hope that helps.

Dave

Viewing 1 replies (of 1 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.