I’m working in a project where we need to use the “WP Cron Job.”
According to the official documentation, we need to schedule our event when our plugin is activated.
And add the according action to our event
The problem here is that we have to wait at least an hour before the action is executed. Obviously, this is not ideal in our workflow.
The temporal solution is: add our custom schedule, in this case, I added one-minute time frame.
Now change the activation code to:
At this point, the cron job must be ready to run every minute and with that let us test our actions.
Please be sure to remove this schedule when you release your plugin.