Forum Replies Created
-
This reply has been marked as private.in reply to: New Update Available – v1.0.88
Hi,
I’m trying to manipulate the $form array using add_filter( ‘userpro_pre_profile_update’, ‘hook_test’, 99, 2 );, but the final results are the same. Nothing changes.I found the solution using
add_filter(‘userpro_before_form_submit’, ‘hook_test’, 99 , 1);
in hook_test function, I’m using userpro_profile_data to get the fields data and update_user_meta to write the calculated values.However, after submition, the form still showing the old values. If I refresh the page, the correct values appears. So, there is one problem to solve: how can I refresh the form to show the updated data after submition?
Ahmed,
Thanks for your support, however I’m a little confused with this hooks. So, please, help me to develop this simple example:Lets admit that I need to get the fiels A and B, execute the operation A + B and put the result into field C when users update their profile.
First, I need to create the UserPro fields. For A, the unique key field is data_a, for B is data_b and for C is result_c. If I understood (probably not) the code for do it is:
<?php
global $userpro;add_filter( ‘userpro_pre_profile_update’, ‘hook_test’, 99, 4 );
function hook_test( $form, $user_id )
{
$form[‘result_c’] = $form[‘data_a’] + $form[‘data_b’];
}?>
This example are a little bit stupid, however will solve my problems.
Thanks again!
keyhanjun,
Thanks a lot! I was using dash! I changed to underscore and, now, are working!
keyhanjun and Ahmed, thanks for reply!
Now I had followed the instructions and my licence key are in my profile. I also write a private reply with the access instructions.
This reply has been marked as private.Hello?!
Please, if is impossible to add new fields to “edit” group, could you help me to add it using some code, SQL query or other way?
Thanks!
Update: UserPro are installed in WordPress 3.9. I turned off all olher plugins and the problem persists. I’m using Mac OS X (10.9.2) and I tryed add new fields to edit form using Firefox, Chrome and Safari.