Plugin Directory

Changeset 1093725


Ignore:
Timestamp:
02/18/2015 10:12:32 PM (11 years ago)
Author:
bcole808
Message:

Hotfix for upgrading

Location:
social-metrics-tracker
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • social-metrics-tracker/tags/1.4.1/social-metrics-tracker.php

    r1093716 r1093725  
    6363
    6464        // Set up options
    65         $this->options = get_option('smt_settings', array());
     65        $this->initOptions();
    6666
    6767        // Ensure setup occurs for each blog when network activated
     
    8181            smt_download_export_file($this);
    8282        }
     83    }
     84
     85    private function initOptions() {
     86        if (is_array($this->options)) return;
     87        $this->options = get_option('smt_settings', array());
    8388    }
    8489
     
    293298    ***************************************************/
    294299    public function get_smt_option($key) {
     300        $this->initOptions();
    295301        return (array_key_exists('smt_options_'.$key, $this->options)) ? $this->options['smt_options_'.$key] : false;
    296302    }
     
    301307    ***************************************************/
    302308    public function set_smt_option($key, $val, $save = true) {
     309        $this->initOptions();
    303310        $this->options['smt_options_'.$key] = $val;
    304311        return ($save) ? $this->save_smt_options() : null;
     
    309316    ***************************************************/
    310317    public function delete_smt_option($key) {
     318        $this->initOptions();
    311319        unset($this->options['smt_options_'.$key]);
    312320        return $this->save_smt_options();
  • social-metrics-tracker/trunk/social-metrics-tracker.php

    r1093716 r1093725  
    6363
    6464        // Set up options
    65         $this->options = get_option('smt_settings', array());
     65        $this->initOptions();
    6666
    6767        // Ensure setup occurs for each blog when network activated
     
    8181            smt_download_export_file($this);
    8282        }
     83    }
     84
     85    private function initOptions() {
     86        if (is_array($this->options)) return;
     87        $this->options = get_option('smt_settings', array());
    8388    }
    8489
     
    293298    ***************************************************/
    294299    public function get_smt_option($key) {
     300        $this->initOptions();
    295301        return (array_key_exists('smt_options_'.$key, $this->options)) ? $this->options['smt_options_'.$key] : false;
    296302    }
     
    301307    ***************************************************/
    302308    public function set_smt_option($key, $val, $save = true) {
     309        $this->initOptions();
    303310        $this->options['smt_options_'.$key] = $val;
    304311        return ($save) ? $this->save_smt_options() : null;
     
    309316    ***************************************************/
    310317    public function delete_smt_option($key) {
     318        $this->initOptions();
    311319        unset($this->options['smt_options_'.$key]);
    312320        return $this->save_smt_options();
Note: See TracChangeset for help on using the changeset viewer.