/** * Set up and return an API connection using the currently saved options.. * * @return WP2D_API The API object. */ public static function api_quick_connect() { $options = WP2D_Options::instance(); $pod = (string) $options->get_option('pod'); $is_secure = true; $username = (string) $options->get_option('username'); $password = WP2D_Helpers::decrypt((string) $options->get_option('password')); $api = new WP2D_API($pod, $is_secure); // This is necessary for correct error handline! if ($api->init()) { $api->login($username, $password); } return $api; }