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.

Custom fields and wp database

Home Forums Community Forum Custom fields and wp database

This topic contains 5 replies, has 2 voices. Last updated by  Bruce 3 years, 8 months ago.

Topic Author Topic
Posted: Thursday Apr 11th, 2013 at 12:59 pm #47206

Hi
When using pp-pro free form or the default free form with custom fields.

The only information that gets added to the db is the 4 default fields and in the wp users table.

I know that the data from the custom fields is being stored somewhere as it is
available under the “Screen Options” tab.

How can I make the 4 default and custom fields place the data in an existing table in the db?

The demographic data the client wants, and gets from the registration form, is very important to
her. So this data has to be put in an existing table in mysql.

The registration form is here: http://vetkuws.com/membership-signup-2/
to view the source.

Appreciate any help someone can give me on this.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Friday Apr 12th, 2013 at 3:33 am #47275
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

I’d recommend setting up API Notifications to handle this. s2Member will still save Custom Fields to their normal place, but you can get the Custom Fields in your API Notifications and save their values wherever you need them as well.

See: Knowledge Base » Building An API Notification Handler

Posted: Friday Apr 12th, 2013 at 8:43 am #47305

Hi Bruce
Thanks. Where is the “normal” place that s2 will save the custom fields? Can’t find any new custom fields in any table in the db.

Ok, been looking at the custom api and related, never done this before so not sure. Still big question, I can’t see any instructions on how to get the data from the custom fields, even with using an api, into the mysql db. Needs to be in it to produce the charts the client wants.

Posted: Saturday Apr 13th, 2013 at 12:13 am #47372
Bruce
Username: Bruce
Staff Member

Thanks. Where is the “normal” place that s2 will save the custom fields? Can’t find any new custom fields in any table in the db.

s2Member saves this data into a serialized PHP array in the WordPress usermeta table. The row name should be s2member_auto_eot_time. You can grab these values with get_user_option(‘s2member_auto_eot_time’, $user_id); in PHP.

Posted: Thursday Apr 25th, 2013 at 7:18 pm #48403

Hi
I’ve looked in the db in wp_usermeta and there is not row: s2member_auto_eot_time

There are only 4 columns. umeta_id, user_id, meta_key, meta_value

I can only find this: wp_s2member_custom_fields under meta_key and it appears to have the custom fields data in it.

As I’m not any good at writing code, would it be possible to get a simple example of the php you suggest I use?

Thanks for your help

Posted: Friday Apr 26th, 2013 at 3:59 am #48449
Bruce
Username: Bruce
Staff Member

Does this work? We’ll want to make sure that the value is being set at all. Make sure to replace $user_id with an ID of a User that should have an EOT Date.

get_user_option(‘s2member_auto_eot_time’, $user_id);
Viewing 5 replies - 1 through 5 (of 5 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.