/**
  * Load plugin settings
  * 
  * @access public
  * @return array
  */
 public function plugin_settings()
 {
     $this->settings = woochimp_plugin_settings();
     $results = array();
     // Iterate over settings array and extract values
     foreach ($this->settings as $page => $page_value) {
         foreach ($page_value['children'] as $subpage => $subpage_value) {
             foreach ($subpage_value['children'] as $section => $section_value) {
                 foreach ($section_value['children'] as $field => $field_value) {
                     if (isset($field_value['default'])) {
                         $results['woochimp_' . $field] = $field_value['default'];
                     }
                 }
             }
         }
     }
     return array_merge($results, get_option('woochimp_options', $results));
 }
Пример #2
0
 /**
  * Loads/sets configuration values from structure file and database
  *
  * @access public
  * @return void
  */
 public function get_config()
 {
     // Settings tree
     $this->settings = woochimp_plugin_settings();
     // Load some data from config
     $this->hints = $this->options('hint');
     $this->validation = $this->options('validation', true);
     $this->titles = $this->options('title');
     $this->options = $this->options('values');
     $this->section_info = $this->get_section_info();
     $this->default_tabs = $this->get_default_tabs();
 }