public function get($site_id = 0)
{
if (!$site_id) {
$site_id = get_current_blog_id();
}
$titles = wp_cache_get($this->cache_key, $this->cache_group);
if (!is_array($titles)) {
$titles = [];
} elseif (isset($titles[$site_id])) {
return $titles[$site_id];
}
// TODO: Don't hardcode the option name.
$languages = get_site_option('inpsyde_multilingual');
// TODO: Maybe also don't hardcode the 'text' key...?
if (!isset($languages[$site_id]['text'])) {
return '';
}
$title = $languages[$site_id]['text'];
$titles[$site_id] = $title;
wp_cache_set($this->cache_key, $titles, $this->cache_group);
return $title;
}