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 Pro form: issue saving custom fields

Home Forums Community Forum Custom Pro form: issue saving custom fields

This topic contains 1 reply, has 2 voices. Last updated by  Cristián Lávaque 3 years, 5 months ago.

Topic Author Topic
Posted: Friday Jul 12th, 2013 at 9:12 am #53346
Jamir Gueye
Username: jimisens

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 :
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:

		<label for="mor_email_pro">Email Pro: </label></br>

Somebody Can Help Me please ??

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Saturday Jul 13th, 2013 at 5:53 am #53376

I don’t see what may be wrong with the code. I’m guessing the problem may be the difference between the must-use and the regular plugin, although I’m not sure how. Have you tested creating a new WP installation to see if you can make must-use plugins work there? I’d probably ask in a WP forum why must-use plugins may not be working, or even contact the webhost for help.

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.