Support

Account

Home Forums Backend Issues (wp-admin) Automatic clear value in date pick – based on actual date

Helping

Automatic clear value in date pick – based on actual date

  • Hello guys,

    im strugling to find to option to auto-clear value of 2 fields. One is holliday start and second is holliday end. So user/admin will set start date and end date of some event. And based on actual date, those field get empty when actual date is > than date filled on holliday end.

    See example on picture. So in this example both fields will clear on 23rd June 2023

  • Is this on a post? Options? Taxonomy?

    You need to build a CRON that looks at wherever the values are stored and checks the dates and then removes them if they are past.

    For example if these fields are on some type of post then the cron needs to do a query that gets all of the posts that have values in this field, loops over those posts, checks the date and then updates or removes the field value.

    https://developer.wordpress.org/plugins/cron/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.