| @@ -130,10 +130,8 @@ | ||
| 130 | 130 | |
| 131 | 131 | if ( !class_exists( 'WP_Improved_Settings\WC_Improved_Settings_API' )) { |
| 132 | 132 | require_once( dirname( __FILE__ ) . '/wp-improved-settings-api.class.php' ); |
| 133 | 133 | } |
| 134 | - | |
| 135 | -/* | |
| 136 | 134 | $this->WC_Improved_Settings_API = new WC_Improved_Settings_API( $this->getPluginID(), $this->getSettingsStructure() ); |
| 137 | 135 | |
| 138 | 136 | |
| 139 | 137 | $key_name = $this->plugin_id . '_options_save'; |
| @@ -148,9 +146,9 @@ | ||
| 148 | 146 | add_action( 'admin_notices', array( $this, 'print_saved_notice' ) ); |
| 149 | 147 | } |
| 150 | 148 | |
| 151 | 149 | add_action( 'admin_notices', array( $this, 'maybe_print_notices' ) ); |
| 152 | -*/ | |
| 150 | + | |
| 153 | 151 | // Migration notices |
| 154 | 152 | //add_action( 'admin_notices', array( $this, 'maybe_display_migration_notice' ), 1 ); |
| 155 | 153 | |
| 156 | 154 | // Delete migration notice |
| @@ -195,11 +193,10 @@ | ||
| 195 | 193 | <?php |
| 196 | 194 | } |
| 197 | 195 | |
| 198 | 196 | public function loadSettings() { |
| 199 | - $this->settingsStructure = $this->getSettingsStructure(); | |
| 200 | - $this->WC_Improved_Settings_API = new WC_Improved_Settings_API( $this->getPluginID(), $this->settingsStructure ); | |
| 201 | 197 | // load settings into $this sttings ? |
| 198 | + $this->settingsStructure = $this->getSettingsStructure(); | |
| 202 | 199 | //plouf( $this->settingsStructure ); die( 'oka6z4e4z64ze4' ); |
| 203 | 200 | } |
| 204 | 201 | |
| 205 | 202 | /** |
| @@ -257,21 +254,8 @@ | ||
| 257 | 254 | if ( !is_admin() ) { |
| 258 | 255 | return; |
| 259 | 256 | } |
| 260 | 257 | |
| 261 | - $key_name = $this->plugin_id . '_options_save'; | |
| 262 | - if ( isset( $_REQUEST['save'] ) && isset( $_REQUEST[$key_name] ) && $_REQUEST[$key_name] ) { | |
| 263 | - $this->saveSettings(); | |
| 264 | -// echo " saving"; | |
| 265 | - if ( method_exists( $this, 'on_save' ) ) { | |
| 266 | -// echo "on save update"; | |
| 267 | - $this->on_save(); | |
| 268 | - } | |
| 269 | - | |
| 270 | - add_action( 'admin_notices', array( $this, 'print_saved_notice' ) ); | |
| 271 | - } | |
| 272 | - add_action( 'admin_notices', array( $this, 'maybe_print_notices' ) ); | |
| 273 | - | |
| 274 | 258 | // Iterate over tabs |
| 275 | 259 | foreach ( $this->settingsStructure as $tab_key => $tab ) { |
| 276 | 260 | // Register tab |
| 277 | 261 | register_setting( |
| @@ -415,9 +399,8 @@ | ||
| 415 | 399 | } |
| 416 | 400 | $active_tab = $this->getActiveTab(); |
| 417 | 401 | $tab_data = $this->settingsStructure[$active_tab]; |
| 418 | 402 | |
| 419 | - | |
| 420 | 403 | //plouf($tab_data, " T AB DATA"); |
| 421 | 404 | |
| 422 | 405 | |
| 423 | 406 | foreach ( $tab_data['sections'] as $section_id => $section ) { |