function update_7_1() { /** @global wpdb $wpdb */ global $wpdb; // Register notifications for translate in WPML. $notifications = AB_Notification::query('n')->select('n.gateway, n.type, n.subject, n.message'); foreach ($notifications->fetchArray() as $notification) { do_action('wpml_register_single_string', 'bookly', $notification['gateway'] . '_' . $notification['type'], $notification['message']); if ($notification['gateway'] == 'email') { do_action('wpml_register_single_string', 'bookly', $notification['gateway'] . '_' . $notification['type'] . '_subject', $notification['subject']); } } $options = $wpdb->get_results('SELECT option_value, option_name FROM ' . $wpdb->options . ' WHERE option_name LIKE \'ab_appearance_text_%\''); foreach ($options as $option) { do_action('wpml_register_single_string', 'bookly', $option->option_name, $option->option_value); } add_option('ab_settings_phone_default_country', 'auto'); }
/** * Constructor */ public function __construct() { date_default_timezone_set(AB_Utils::getTimezoneString()); wp_load_translations_early(); $now = new DateTime(); $this->mysql_now = $now->format('Y-m-d H:i:s'); $this->sms = new AB_SMS(); $this->sms_authorized = $this->sms->loadProfile(); $query = AB_Notification::query()->where('active', 1)->whereIn('type', array('staff_agenda', 'client_follow_up', 'client_reminder')); foreach ($query->find() as $notification) { $this->processNotification($notification); } }