get_col("SELECT DISTINCT m.meta_value FROM $wpdb->postmeta as m JOIN $wpdb->posts as p ON m.post_id = p.ID WHERE m.meta_key = 'timezone' AND p.post_type = 'tsml_location' AND p.post_status = 'publish'"); $meeting_timezones[] = $tsml_timezone; $meeting_timezones = array_filter(array_unique($meeting_timezones)); $used = []; foreach ($meeting_timezones as $timezone) { if (in_array($timezone, $all_timezones)) { list($continent, $city) = explode('/', $timezone, 2); $used[$timezone] = str_replace(['_', '/'], [' ', ' - '], $city); } } $continents = []; foreach ($all_timezones as $timezone) { if (in_array($timezone, $meeting_timezones) || !substr_count($timezone, '/')) { continue; } list($continent, $city) = explode('/', $timezone, 2); if (!isset($continents[$continent])) { $continents[$continent] = []; } $continents[$continent][$timezone] = str_replace('_', ' ', str_replace('/', ' - ', $city)); } $continents['UTC'] = ['UTC' => 'UTC']; ?> $tz_aliases) { $match = array_filter($tz_aliases, function($alias) use ($value_match) { return $value_match === strtolower($alias); }); if (count($match)) { $timezone = $tz_value; break; } } } // cache result, less looping later $_tsml_timezone_matches[$value] = $timezone; return $timezone; }