| @@ 116-124 (lines=9) @@ | ||
| 113 | public function process_admin_options() { |
|
| 114 | $this->init_settings(); |
|
| 115 | ||
| 116 | foreach ( $this->get_form_fields() as $key => $field ) { |
|
| 117 | if ( ! in_array( $this->get_field_type( $field ), array( 'title' ) ) ) { |
|
| 118 | try { |
|
| 119 | $this->settings[ $key ] = $this->get_field_value( $key, $field ); |
|
| 120 | } catch ( Exception $e ) { |
|
| 121 | $this->add_error( $e->getMessage() ); |
|
| 122 | } |
|
| 123 | } |
|
| 124 | } |
|
| 125 | ||
| 126 | return update_option( $this->get_option_key(), apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ) ); |
|
| 127 | } |
|
| @@ 452-460 (lines=9) @@ | ||
| 449 | if ( $this->instance_id ) { |
|
| 450 | $this->init_instance_settings(); |
|
| 451 | ||
| 452 | foreach ( $this->get_instance_form_fields() as $key => $field ) { |
|
| 453 | if ( ! in_array( $this->get_field_type( $field ), array( 'title' ) ) ) { |
|
| 454 | try { |
|
| 455 | $this->instance_settings[ $key ] = $this->get_field_value( $key, $field ); |
|
| 456 | } catch ( Exception $e ) { |
|
| 457 | $this->add_error( $e->getMessage() ); |
|
| 458 | } |
|
| 459 | } |
|
| 460 | } |
|
| 461 | ||
| 462 | return update_option( $this->get_instance_option_key(), apply_filters( 'woocommerce_shipping_' . $this->id . '_instance_settings_values', $this->instance_settings, $this ) ); |
|
| 463 | } else { |
|