php – Updating WordPress publish posts dates using cron-job

Exception or error:

I was looking for help in a particular topic in WordPress in which I haven’t worked before. I’m unable to get how to work

with cron-job and its settings.

There are Three posts in WordPress, now these three posts are event posts which is showing event name, event day, event date and event time.

I need to work only with “event date“. After doing a bit research stuffs I found that I need to setup a cron job in the

three posts for updating the “event date” fields.

In these three posts following are their respective datas from which I only need to work with “event date” which is the

only section which is important for me at the present moment.

Event 1 Name :- HEALING NIGHT
Event 1 Date :- February 21, 2020
Event 1 Day :- Friday
Event 1 Time :- 7:30 pm

Event 2 Date :- February 23, 2020
Event 2 Day :- Sunday
Event 2 Time :- 10:00 am

Event 2 Date :- February 25, 2020
Event 2 Day :- Tuesday
Event 2 Time :- 7:30 pm

Now for these three events there are 3 posts as I mentioned earlier. I am explaining by taking an event for example and then explaining all 3 events alongside.

In the first event the “Event 1 Date” is “February 21, 2020“. I need to setup a cron-job (as per my thinking) for automatically updating the “Event 1 Date” as NEXT SEVENTH DAY just after 12:00 AM (midnight of February 21, 2020) i’e it AUTOMATICALLY GETS UPDATED to the “Event 1 Date :- February 28, 2020” and then automatically to “Event 1 Date :- March 6, 2020” and so on. This process will run with respect to all the three posts accordingly.

Like for example for the second event the next “event date” will be “Event 2 Date :- March 1, 2020” and then “Event 2 Date :- March 8, 2020” and so on.

Like for example for the third event the next “event date” will be “Event 2 Date :- March 3, 2020” and then “Event 3 Date :- March 10, 2020” and so on.

All these dates and day will be with respect to Australian Standard time Zone.

Any help is appreciated.

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *