skip to Main Content

having a issue with getting a ACF field associated with a user profile to update after a gravity form submission. As it stands, this logic currently does nothing :(. So i’m hoping someone can help out. Here is waht I have so far:

//changes studio status after those forms submit
function update_user_tour_status($entry, $form){
    $user_id = $entry['created_by'];
    $state = update_user_meta('user_'.$user_id, 'artist_tour_status', 'studio');
}
add_action('gform_after_submisson_7', 'update_user_tour_status', 10, 2);

So it should be pretty straight forward I would image, but it just seems to do nothing.

2

Answers


  1. According to the update_user_meta(); reference, the first argument should only be the user’s ID. user_ does not need to be appended, as the function expects an integer, not a string. Drop the user_ prefix, and it should work like a charm.

    Login or Signup to reply.
  2. Check update_user_meta()

    //changes studio status after those forms submit
    function update_user_tour_status( $entry, $form ){
        $user_id = $entry['created_by'];
        $state   = update_user_meta( $user_id, 'artist_tour_status', 'studio' );
    }
    add_action( 'gform_after_submisson_7', 'update_user_tour_status', 10, 2 );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search