Update languages and geolocation when installed

This commit is contained in:
Mike Jolley 2015-02-11 14:38:52 +00:00
parent 14598bfd40
commit bc2af10cc6
3 changed files with 2 additions and 4 deletions

View File

@ -47,6 +47,7 @@ class WC_Geolocation {
*/
public static function init() {
add_action( 'woocommerce_geoip_updater', array( __CLASS__, 'update_database' ) );
add_action( 'woocommerce_installed', array( __CLASS__, 'update_database' ) );
}
/**

View File

@ -160,7 +160,6 @@ class WC_Install {
wp_clear_scheduled_hook( 'woocommerce_scheduled_sales' );
wp_clear_scheduled_hook( 'woocommerce_cancel_unpaid_orders' );
wp_clear_scheduled_hook( 'woocommerce_cleanup_sessions' );
wp_clear_scheduled_hook( 'woocommerce_language_pack_updater_check' );
wp_clear_scheduled_hook( 'woocommerce_geoip_updater' );
wp_clear_scheduled_hook( 'woocommerce_tracker_send_event' );
@ -175,8 +174,6 @@ class WC_Install {
}
wp_schedule_event( time(), 'twicedaily', 'woocommerce_cleanup_sessions' );
wp_schedule_single_event( time(), 'woocommerce_language_pack_updater_check' );
wp_schedule_single_event( time(), 'woocommerce_geoip_updater' );
wp_schedule_event( strtotime( 'first tuesday of next month' ), 'monthly', 'woocommerce_geoip_updater' );
wp_schedule_event( time(), apply_filters( 'woocommerce_tracker_event_recurrence', 'daily' ), 'woocommerce_tracker_send_event' );
}

View File

@ -30,7 +30,7 @@ class WC_Language_Pack_Upgrader {
public function __construct() {
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_for_update' ) );
add_filter( 'upgrader_pre_download', array( $this, 'version_update' ), 10, 2 );
add_action( 'woocommerce_language_pack_updater_check', array( $this, 'has_available_update' ) );
add_action( 'woocommerce_installed', array( $this, 'has_available_update' ) );
add_filter( 'admin_init', array( $this, 'manual_language_update' ), 999 );
}