/** * Saves profile field values to the database on profile update. * * @global $_POST Used to access values submitted by profile form. * * @param int $user_id * * @uses WP_Buoy_User_Settings::set() * @uses WP_Buoy_User_Settings::save() * * @return void */ public static function saveProfile($user_id) { $options = new WP_Buoy_User_Settings($user_id); $options->set('gender_pronoun_possessive', sanitize_text_field($_POST[self::$prefix . '_gender_pronoun_possessive']))->set('phone_number', sanitize_text_field($_POST[self::$prefix . '_phone_number']))->set('sms_provider', sanitize_text_field($_POST[self::$prefix . '_sms_provider']))->set('crisis_message', sanitize_text_field($_POST[self::$prefix . '_crisis_message']))->set('public_responder', isset($_POST[self::$prefix . '_public_responder']) ? true : false)->save(); }
/** * Saves a flag in the user's options that tells Buoy not to show * the "webapp installer" scripts again. * * @uses check_ajax_referer() * @uses get_current_user_id() * @uses WP_Buoy_User_Settings::set() * @uses WP_Buoy_User_Settings::save() * @uses wp_send_json_success() * * @return void */ public static function handleDismissInstaller() { check_ajax_referer(self::$prefix . '_incident_nonce', self::$prefix . '_nonce'); $usropt = new WP_Buoy_User_Settings(get_current_user_id()); $usropt->set('installer_dismissed', true)->save(); wp_send_json_success(); }
/** * Makes this team the default team of the author. * * @uses WP_Buoy_User_Settings::set() * @uses WP_Buoy_User_Settings::save() * * @return WP_Buoy_Team */ public function make_default() { $usropt = new WP_Buoy_User_Settings($this->author->ID); $usropt->set('default_team', $this->wp_post->ID)->save(); return $this; }