How to set up WP Cron in this scenario

First things first: Say hello! to $wpdb

The wpdb Class is what you take to interact with the database on it’s most basic level. Forget all those mysql_* functions, when it comes to WordPress. The core has a nice wrapper, that makes most things pretty safe for you (hint: SQL-injections and other bad boys). Or at least offers things, that you can use to make it safe (like_escape(), $wpdb->prepare() to mention some).


The Schedule API

WordPress comes with some sort of pseudo Cron Job:

  • Schedule API It’s not that well documented, but this is what comes a real Cron Job closest. Make sure, that you read everything about it and try it in a clean install.

I have written a small plugin, that will allow you inspect what you’re doing. It’s called »WP Cron Jobs List« and is hosted on GitHub/Gist or via our own WPSE Plugin repository.

enter image description here

Leave a Comment