Add monthly cron schedule

@claudiosmweb
This commit is contained in:
Mike Jolley 2015-09-03 16:21:53 +01:00
parent 32b220d8b6
commit 8149213c4b
1 changed files with 14 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class WC_Install {
add_filter( 'plugin_action_links_' . WC_PLUGIN_BASENAME, array( __CLASS__, 'plugin_action_links' ) );
add_filter( 'plugin_row_meta', array( __CLASS__, 'plugin_row_meta' ), 10, 2 );
add_filter( 'wpmu_drop_tables', array( __CLASS__, 'wpmu_drop_tables' ) );
add_filter( 'cron_schedules', array( __CLASS__, 'cron_schedules' ) );
}
/**
@ -181,6 +182,19 @@ class WC_Install {
self::update_db_version();
}
/**
* Add more cron schedules
* @param array $schedules
* @return array
*/
public static function cron_schedules( $schedules ) {
$schedules['monthly'] = array(
'interval' => 2635200,
'display' => __( 'Monthly', 'woocommerce' )
);
return $schedules;
}
/**
* Create cron jobs (clear them first)
*/