static function init() { $options = get_option(GMW_OPTIONS); self::check_opt_in_out(); // ask user if he wants to allow tracking if (is_admin() && !isset($options['allow_tracking'])) { add_action('admin_notices', array(__CLASS__, 'tracking_notice')); } add_action(GMW_CRON, array(__CLASS__, 'send_data')); // todo - write this properly, so it doesn't run each time, $force ... GMW_tracking::setup_cron(); }
static function deactivate() { $options = get_option(GMW_OPTIONS); if (isset($options['allow_tracking']) && $options['allow_tracking'] === true) { GMW_tracking::clear_cron(); } }
static function init() { self::check_opt_in_out(); add_action(GMW_CRON, array(__CLASS__, 'send_data')); GMW_tracking::setup_cron(); }