title: Having trouble adding validation errors to ACF form
body: <p>I'm using ACF with WordPress and I have a form that I am trying to add a validation error to, but it doesn't appear to be working (I think I know why)...</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>function my_acf_update_value( $value, $post_id, $field  ) {
  
      // Get the users numerical user id
      $user_id = str_replace('user_', '', $post_id);
  
      $value = sanitize_text_field($value);
  
      /** @noinspection PhpParamsInspection */
      $user_data = wp_update_user(array('ID' =&gt; $user_id, 'user_email' =&gt; $value ) );
  
      if ( is_wp_error( $user_data ) ) {
          $wp_error = $user_data-&gt;get_error_message();
          $input = $field['prefix'] . '[' . $field['key'] . ']';
          acf_add_validation_error($input, $wp_error);
      }
  
      return $value;
  
  }
  
  add_filter('acf/update_value/key=field_5c121023e119f', 'my_acf_update_value', 10, 3);
  </code></pre>
  
  <p>As you may be able to tell I am attempting to update the users email address field (default WP one) based off the email provided by a user in an email field on a frontend ACF Form.</p>
  
  <p>I then check to see if the update caused any errors and obviously if it did I want to add to the ACF validation errors, but it passers through successfully.</p>
  
  <p>I <em>assume</em> this is because the <em>update</em> function runs AFTER the validation and this is why it isn't working?</p>
  
  <p>Because of this I thought about doing the update in the validation function such as:</p>
  
  <pre><code>function my_acf_validate_value( $valid, $value, $field, $input ){
  
      // bail early if value is already invalid
      if( !$valid ) {
          return $valid;
      }
  
      // Some code...
  
      // Return error here?
      return $valid;
  
  }
  
  add_filter('acf/validate_value/key=field_5c121023e119f', 'my_acf_validate_value', 10, 4);
  </code></pre>
  
  <p>...but I don't seem to have access to the <code>$post_id</code> here, nor does this seem like the best way to handle it?</p>
  
  <p>Is there a way to handle this better?</p>