| @@ 127-135 (lines=9) @@ | ||
| 124 | public function process_admin_options() { |
|
| 125 | $this->init_settings(); |
|
| 126 | ||
| 127 | foreach ( $this->get_form_fields() as $key => $field ) { |
|
| 128 | if ( ! in_array( $this->get_field_type( $field ), array( 'title' ) ) ) { |
|
| 129 | try { |
|
| 130 | $this->settings[ $key ] = $this->get_field_value( $key, $field ); |
|
| 131 | } catch ( Exception $e ) { |
|
| 132 | $this->add_error( $e->getMessage() ); |
|
| 133 | } |
|
| 134 | } |
|
| 135 | } |
|
| 136 | ||
| 137 | return update_option( $this->get_option_key(), apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ) ); |
|
| 138 | } |
|
| @@ 449-457 (lines=9) @@ | ||
| 446 | if ( $this->instance_id ) { |
|
| 447 | $this->init_instance_settings(); |
|
| 448 | ||
| 449 | foreach ( $this->get_instance_form_fields() as $key => $field ) { |
|
| 450 | if ( ! in_array( $this->get_field_type( $field ), array( 'title' ) ) ) { |
|
| 451 | try { |
|
| 452 | $this->instance_settings[ $key ] = $this->get_field_value( $key, $field ); |
|
| 453 | } catch ( Exception $e ) { |
|
| 454 | $this->add_error( $e->getMessage() ); |
|
| 455 | } |
|
| 456 | } |
|
| 457 | } |
|
| 458 | ||
| 459 | return update_option( $this->get_instance_option_key(), apply_filters( 'woocommerce_shipping_' . $this->id . '_instance_settings_values', $this->instance_settings, $this ) ); |
|
| 460 | } else { |
|