function get_current_season() { if ($this->currentSeason) { return $this->currentSeason; } $season = null; $db = new KKL_DB(); if ($_GET['game_day_filter']) { $season = $db->getSeasonForGameday($_GET['game_day_filter']); } elseif ($_GET['season_filter']) { $season = $db->getSeason($_GET['season_filter']); } elseif ($this->get_current_league()) { $season = $db->getCurrentSeason($this->get_current_league()->id); } $this->currentSeason = $season; return $season; }