Support

Account

Home Forums Front-end Issues profile_update hook and acf frontend form Reply To: profile_update hook and acf frontend form

  • acf/save_posts is run on any page where custom field are shown and only when there are acf fields shown and submitted.

    If acf/save_post is not running then there are not acf fields being submitted.

    when ACF passes the $post_id value to your filter it will be in the form

    
    "user_{$user_id}"
    

    in order to use standard WP function you will need to extract the user ID

    
    function whatever_your_function_name_is($post_id) {
      // see if the post ID is for a user
      if (strpos($post_id, 'user_') !== 0) {
        // string does not start with user_
        // bail
        return;
      }
      $user_id = intval(substr($post_id, 5));
      // your code to update user here
    }