Changeset 1093725
- Timestamp:
- 02/18/2015 10:12:32 PM (11 years ago)
- Location:
- social-metrics-tracker
- Files:
-
- 2 edited
-
tags/1.4.1/social-metrics-tracker.php (modified) (5 diffs)
-
trunk/social-metrics-tracker.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
social-metrics-tracker/tags/1.4.1/social-metrics-tracker.php
r1093716 r1093725 63 63 64 64 // Set up options 65 $this-> options = get_option('smt_settings', array());65 $this->initOptions(); 66 66 67 67 // Ensure setup occurs for each blog when network activated … … 81 81 smt_download_export_file($this); 82 82 } 83 } 84 85 private function initOptions() { 86 if (is_array($this->options)) return; 87 $this->options = get_option('smt_settings', array()); 83 88 } 84 89 … … 293 298 ***************************************************/ 294 299 public function get_smt_option($key) { 300 $this->initOptions(); 295 301 return (array_key_exists('smt_options_'.$key, $this->options)) ? $this->options['smt_options_'.$key] : false; 296 302 } … … 301 307 ***************************************************/ 302 308 public function set_smt_option($key, $val, $save = true) { 309 $this->initOptions(); 303 310 $this->options['smt_options_'.$key] = $val; 304 311 return ($save) ? $this->save_smt_options() : null; … … 309 316 ***************************************************/ 310 317 public function delete_smt_option($key) { 318 $this->initOptions(); 311 319 unset($this->options['smt_options_'.$key]); 312 320 return $this->save_smt_options(); -
social-metrics-tracker/trunk/social-metrics-tracker.php
r1093716 r1093725 63 63 64 64 // Set up options 65 $this-> options = get_option('smt_settings', array());65 $this->initOptions(); 66 66 67 67 // Ensure setup occurs for each blog when network activated … … 81 81 smt_download_export_file($this); 82 82 } 83 } 84 85 private function initOptions() { 86 if (is_array($this->options)) return; 87 $this->options = get_option('smt_settings', array()); 83 88 } 84 89 … … 293 298 ***************************************************/ 294 299 public function get_smt_option($key) { 300 $this->initOptions(); 295 301 return (array_key_exists('smt_options_'.$key, $this->options)) ? $this->options['smt_options_'.$key] : false; 296 302 } … … 301 307 ***************************************************/ 302 308 public function set_smt_option($key, $val, $save = true) { 309 $this->initOptions(); 303 310 $this->options['smt_options_'.$key] = $val; 304 311 return ($save) ? $this->save_smt_options() : null; … … 309 316 ***************************************************/ 310 317 public function delete_smt_option($key) { 318 $this->initOptions(); 311 319 unset($this->options['smt_options_'.$key]); 312 320 return $this->save_smt_options();
Note: See TracChangeset
for help on using the changeset viewer.