I wanted to use Wordpress built in WP Cron to update currency rates daily.
I use this function currently,
require_once(WP_PLUGIN_DIR . '/autocurupdate/currencyexchange_class.php');
$cx=new currencyExchange();
$cx->getData();
$currency_sql = "select last_updated from " . $wpdb->prefix."currencies where code = 'PHP'";
$currency_1 = mysql_query($currency_sql);
$currency_2 = mysql_fetch_array($currency_1);
$last_updated = mysql2date(get_option('date_format'), $currency_2['last_updated']);
$current_date = $cx->Date;
$currentdate = mysql2date(get_option('date_format'), $current_date);
if($last_updated !== $currentdate) {
update_currency();
}
How can I run update_currency() function daily using WP Cron?
