Support

Account

Home Forums Backend Issues (wp-admin) Calculate PHP date_diff and save to ACF Field during post creation Reply To: Calculate PHP date_diff and save to ACF Field during post creation

  • In theory, you should be able to add it below:
    $post_id = wp_insert_post($new_post);

    Reason being, you’ve accessed the order info, you’ve created the post and have the ID.

    The only part you need to check is that date formats are correct and you change the custom_field name to your field.

    Code is untested, so you may need to check, test and debug by echoing out various points to see if it works