Hello,
I am currently looking for a method to solve this problem.
I must be able to publish and edit a post back and front.
This post contains an ACF Date field that replaces the post date when one is saving.
For the back so no problem.
For the front:
Problem1:
The user must not be able to create a new post if there is already one at this date.
Solution 1:
– Automatic daily post creation with a CRON (post_date = date today)
– View a list (or calendar) of existing posts
– Editing the onClick record on the date
For now I use this plugin to manage my forms but I can also work directly with ACF form if it is necessary.
https://codecanyon.net/item/acf-front-form-for-elementor-page-builder/21887968
Solution 2:
– Automatic daily post creation with a CRON (post_date = date today)
– Create other forms that only modify some fields of the form but not the post update (update post meta). But problem if a user edited at the same time back.
Solution 3
– Manual creation of the post back and front
– If a post exists with this date -> returns to edition.
If you think of other solutions …
Thank you so much !
1) Use an acf/validate_value filter on the date field to return an error if the date is already used https://www.advancedcustomfields.com/resources/acf-validate_value/
2) Implement this on the date field in combination with the ACF JS API (I don’t know how to do this, just something to think about) https://dzone.com/articles/disable-dates-in-datepicker, https://www.advancedcustomfields.com/resources/javascript-api/