Support

Account

Home Forums ACF PRO update_field() returning FALSE if value to update is not changed… Reply To: update_field() returning FALSE if value to update is not changed…

  • I can understand your frustrations a bit, but I can also guess to some degree the developer’s thinking is that it works consistent with the way update_post_meta() works and update_field() is just a wrapper for update_post_meta().

    Returns meta_id if the meta doesn’t exist, otherwise returns true on success and false on failure. NOTE: If the meta_value passed to this function is the same as the value that is already in the database, this function returns false.

    Maybe when he gets time he’ll add it to the documentation. I’m also assuming that since update_field() does not mention returned values that it’s not expected that anyone would be testing the returned value. The function is not going to “Fail”, after it is called the field value for the post_id will be set to you want to update it to, one way or another.