Home Forums ACF PRO Previous and next get fileds Reply To: Previous and next get fileds

  • gonna be honest, not sure what you’re doing there, so here’s another stab code to explain what I was doing.

    add_action('acf/save_post', 'my_acf_save_post', 1);
    function my_acf_save_post($post_id) {
      // you need the field key of the field you want to check
      $field_to_check_key = 'field_585d2d2af8d69';
      // see if this field is set
      if (isset($_POST['acf'][$field_to_check_key])) {
        // this field is not submitted, must be a different group
      // the new value is submitted
      $new_value = $_POST['acf'][$field_to_check_key];
      // get the old value
      $old_value = get_field('luc_nham_0_can', $post_id, false);
      // test new value to see if it's different than old value
      if ($new_value != $old_value) {
        // it is different
        // do something