| @@ 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 | } |
|
| @@ 446-454 (lines=9) @@ | ||
| 443 | if ( $this->instance_id ) { |
|
| 444 | $this->init_instance_settings(); |
|
| 445 | ||
| 446 | foreach ( $this->get_instance_form_fields() as $key => $field ) { |
|
| 447 | if ( ! in_array( $this->get_field_type( $field ), array( 'title' ) ) ) { |
|
| 448 | try { |
|
| 449 | $this->instance_settings[ $key ] = $this->get_field_value( $key, $field ); |
|
| 450 | } catch ( Exception $e ) { |
|
| 451 | $this->add_error( $e->getMessage() ); |
|
| 452 | } |
|
| 453 | } |
|
| 454 | } |
|
| 455 | ||
| 456 | return update_option( $this->get_instance_option_key(), apply_filters( 'woocommerce_shipping_' . $this->id . '_instance_settings_values', $this->instance_settings, $this ) ); |
|
| 457 | } else { |
|