Пример #1
0
 /**
  * Checks if option still has the default value
  *
  * @param string $option
  *
  * @return bool
  * @since 2.6
  */
 protected function hasDefaultValue($option)
 {
     $defaultConfig = new UTCW_RenderConfig(array(), $this->plugin);
     $defaults = $defaultConfig->getInstance();
     $config = $this->plugin->get('renderConfig');
     return $config->{$option} === $defaults[$option];
 }
Пример #2
0
 /**
  * Action handler for the form in the admin panel
  *
  * @param array $new_instance
  * @param array $old_instance
  *
  * @return array
  * @since 1.0
  */
 public function update($new_instance, $old_instance)
 {
     $new_instance = $this->load_config($new_instance);
     $new_instance = $this->check_booleans($new_instance);
     $dataConfig = new UTCW_DataConfig($new_instance, $this->plugin);
     $renderConfig = new UTCW_RenderConfig($new_instance, $this->plugin);
     $config = array_merge($dataConfig->getInstance(), $renderConfig->getInstance());
     $this->save_config($new_instance, $config);
     $this->remove_configs($new_instance);
     return $config;
 }