protected function getInternalAdminOptions()
{
// Reload options if blog has been switched
if (empty($this->adminOptions) || get_current_blog_id() !== $this->blogId) {
$this->adminOptions = array();
}
if (!empty($this->adminOptions)) {
return $this->adminOptions;
}
// Check if we have options saved already.
$currentOptions = get_option($this->optionNamespace . '_options');
// First time run, this action hook can be used to trigger something.
if (false === $currentOptions) {
do_action('tf_init_no_options_' . $this->optionNamespace);
}
// Put all the available options in our global variable for future checking.
if (!empty($currentOptions) && !count($this->adminOptions)) {
$this->adminOptions = unserialize($currentOptions);
}
if (empty($this->adminOptions)) {
$this->adminOptions = array();
}
return $this->adminOptions;
}