Hello,
I’m actually trying to save some custom fields in the database made in a custom paypal pro form template, but it doesn’t work as spected .
I follow this method : http://www.s2member.com/kb/pro-forms/#customizing-pro-forms
I cannot use “Must Use Plugins” in my installation (i don’t know why). Every time i try too install a must-use-plugin with some PHP code, my server crashes. So i decide to make a plugin and activate it network side. I did the same for others s2members hooks and it works perfectly !
The code in my custom S2members-Hacks Plugin (Activated Network Side):
add_action('ws_plugin__s2member_during_configure_user_registration', 'store_my_custom_input_fields');
function store_my_custom_input_fields($vars = array())
{
$user = $vars['user']; // A WP_user object instance.
$_p = stripslashes_deep($_POST); // $_POST vars via form submission
if(!empty($_p['phys_adresse_res']) && is_string($_p['phys_adresse_res']))
update_user_option($user->ID, 'phys_adresse_res', esc_html($_p['phys_adresse_res']),true);
if(!empty($_p['phys_email_pro']) && is_string($_p['phys_email_pro']))
update_user_option($user->ID, 'phys_email_pro', esc_html($_p['phys_email_pro']),true);
if(!empty($_p['phys_tel']) && is_string($_p['phys_tel']))
update_user_option($user->ID, 'phys_tel', esc_html($_p['phys_tel']),true);
if(!empty($_p['phys_num_com']) && is_string($_p['phys_num_com']))
update_user_option($user->ID, 'phys_num_com', esc_html($_p['phys_num_com']),true);
if(!empty($_p['phys_num_fisc']) && is_string($_p['phys_num_fisc']))
update_user_option($user->ID, 'phys_num_fisc', esc_html($_p['phys_num_fisc']),true);
if(!empty($_p['raison_sociale']) && is_string($_p['raison_sociale']))
update_user_option($user->ID, 'raison_sociale', esc_html($_p['raison_sociale']),true);
if(!empty($_p['adresse_societe']) && is_string($_p['adresse_societe']))
update_user_option($user->ID, 'adresse_societe', esc_html($_p['adresse_societe']),true);
if(!empty($_p['mor_email_pro']) && is_string($_p['mor_email_pro']))
update_user_option($user->ID, 'mor_email_pro', esc_html($_p['mor_email_pro']),true);
if(!empty($_p['mor_tel']) && is_string($_p['mor_tel']))
update_user_option($user->ID, 'mor_tel', esc_html($_p['mor_tel']),true);
if(!empty($_p['mor_num_com']) && is_string($_p['mor_num_com']))
update_user_option($user->ID, 'mor_num_com', esc_html($_p['mor_num_com']),true);
if(!empty($_p['mor_num_fisc']) && is_string($_p['mor_num_fisc']))
update_user_option($user->ID, 'mor_num_fisc', esc_html($_p['mor_num_fisc']),true);
}
In my cutom paypal pro form template i show the fields in this manner:
<div>
<label for="mor_email_pro">Email Pro: </label></br>
<br>
</div>
Somebody Can Help Me please ??