Support

Account

Home Forums Backend Issues (wp-admin) acf/save_post – execute only when value of field has changed Reply To: acf/save_post – execute only when value of field has changed

  • When you submit values through a form on a web page the browser may escape special characters like single quotes. It may also convert html entities. These changes may cause the two compared values to look the same but to actually be different strings when compared.

    However, looking back at your code I thing the reason for your problem is something else that I missed the last time. You need to supply the post ID when getting fields.

    
    if ($_POST['acf']['field_5fd213a8c6dfe'] != get_field('field_5fd213a8c6dfe', $post_id)){