Update languages and geolocation when installed
This commit is contained in:
parent
14598bfd40
commit
bc2af10cc6
|
@ -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' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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' );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue