Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ali Qureshi

    (@parorrey)

    your code will be following;

    if($user_id) {
    
    $msg = 'Success';
    
    $meta_key = $_REQUEST['meta_key'];
    $meta_value = $_REQUEST['meta_value'];
    update_user_meta($user_id, $meta_key, $meta_value);
    
    }
    Thread Starter markbautista

    (@markbautista)

    Hi Ali, Thank you for the response however i can’t find where to put this code? I mean, It says that look for this if($user_id) $msg = ‘Success’; But seems i can’t find this on user.php?

    Thank you very much Ali.

    Thread Starter markbautista

    (@markbautista)

    Finally got this working,

    The plugin JSON API 0.1 has this line:
    if($user_id) $msg = ‘Success’

    While the JSON API 2.5 has this line:
    if($user_id) wp_new_user_notification( $user_id, '',$notify );

    Sir. Ali is right, you just replace this if($user_id) wp_new_user_notification( $user_id, '',$notify );
    to

    if($user_id) {
    
    $msg = 'Success';
    
    $meta_key = $_REQUEST['meta_key'];
    $meta_value = $_REQUEST['meta_value'];
    update_user_meta($user_id, $meta_key, $meta_value);
    }

    Thank you very much Ali.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Create User with Existing User Meta’ is closed to new replies.