Support

Account

Home Forums ACF PRO update_field date field not displaying date on the admin front-end Reply To: update_field date field not displaying date on the admin front-end

  • Hmmm, I had tried it with quotes also. Either way, with or without the quotes, it reads the field OK and does the calculation as expected.

    I also read somewhere (forgotten where, amongst all the Googling!) that with date types, the field key should be used instead of the field name.

    Field name, field key, with and without quotes, the update field doesn’t seem to write data and the field remains blank.

    I tried also adding $post_id too, although I believe this defaults to the current post anyway.

    $reviewDate = get_field('document_review_date');
    $remindDate = date("Ymd", strtotime($reviewDate . '-7 days'));
    update_field('field_60f4466dcddc8', $remindDate, $post_id);