Setup wordpress cron jobs and debug methods

Setup wordpress cron jobs and debug methods

Why would you need to setup Wordpress cron jobs ? Cron jobs in Wordpress can be set for following reasons You have a custom post type for events and you wish to archive all your old events at regular intervals Archive logs e.g. if you have some plugin which tracks user activity then you may want to archive the logs table at regular intervals If you have integrated wordpress with some external application e.g. a mailing server then you need to synchronise your mailing lists with the external server Clearing caches for certain pages How to setup wordpress cron jobs wp_schedule_event is the function used to set up wordpress cron jobs Here's a sample code to set up a cron job [crayon-59c0ff70c1dc0940201466/] The above code will execute the function wpi_some_cron_job on daily basis. Some of the other options are hourly, twicedaily Now the question is where do we add the above code. The answer to this depends whether you want to set this up as part of your own...
Read More