Re-init settings after saving. Closes #3770.
This commit is contained in:
parent
e3680ef670
commit
21f48bea99
|
@ -25,7 +25,7 @@ abstract class WC_Integration extends WC_Settings_API {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function admin_options() { ?>
|
||||
public function admin_options() { ?>
|
||||
|
||||
<h3><?php echo isset( $this->method_title ) ? $this->method_title : __( 'Settings', 'woocommerce' ) ; ?></h3>
|
||||
|
||||
|
@ -40,5 +40,4 @@ abstract class WC_Integration extends WC_Settings_API {
|
|||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
|
@ -75,6 +75,7 @@ abstract class WC_Settings_API {
|
|||
return false;
|
||||
} else {
|
||||
update_option( $this->plugin_id . $this->id . '_settings', apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->sanitized_fields ) );
|
||||
$this->init_settings();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -103,10 +104,6 @@ abstract class WC_Settings_API {
|
|||
* @return void
|
||||
*/
|
||||
public function init_settings() {
|
||||
|
||||
if ( ! empty( $this->settings ) )
|
||||
return;
|
||||
|
||||
// Load form_field settings
|
||||
$this->settings = get_option( $this->plugin_id . $this->id . '_settings', null );
|
||||
|
||||
|
@ -121,8 +118,8 @@ abstract class WC_Settings_API {
|
|||
}
|
||||
|
||||
if ( $this->settings && is_array( $this->settings ) ) {
|
||||
$this->settings = array_map( array( $this, 'format_settings' ), $this->settings );
|
||||
$this->enabled = isset( $this->settings['enabled'] ) && $this->settings['enabled'] == 'yes' ? 'yes' : 'no';
|
||||
$this->settings = array_map( array( $this, 'format_settings' ), $this->settings );
|
||||
$this->enabled = isset( $this->settings['enabled'] ) && $this->settings['enabled'] == 'yes' ? 'yes' : 'no';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,7 @@ class WC_Integrations {
|
|||
|
||||
$load_integration = new $integration();
|
||||
|
||||
$this->integrations[$load_integration->id] = $load_integration;
|
||||
|
||||
$this->integrations[ $load_integration->id ] = $load_integration;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue