/** * Get Instance Class * * @return C3_Auth * @since 4.0.0 * @access public */ public static function get_instance() { if (!isset(self::$instance)) { $c = __CLASS__; self::$instance = new $c(); } return self::$instance; }
/** * Controller of C3 plugin * * @access public * @param none * @return none * @since 4.0.0 */ public function update_settings() { if (empty($_POST)) { return; } if ($this->is_trust_post_param(C3_Base::C3_AUTHENTICATION)) { $options = $this->_esc_setting_param($_POST[C3_Base::OPTION_NAME]); update_option(C3_Base::OPTION_NAME, $options); $auth = C3_Auth::get_instance(); $result = $auth->auth($options); if (is_wp_error($result)) { //@TODO Show WP Error message } } if ($this->is_trust_post_param(C3_Base::C3_INVALIDATION)) { $invalidator = C3_Invalidation::get_instance(); $result = $invalidator->invalidation(); if (is_wp_error($result)) { //@TODO Show WP Error message } } }