| @@ -85,14 +85,8 @@ | ||
| 85 | 85 | */ |
| 86 | 86 | public function get_settings( $request ) { |
| 87 | 87 | unset( $request ); // Unused parameter. |
| 88 | 88 | |
| 89 | - // get_all_offline_settings() already fills the default template only when | |
| 90 | - // nothing has ever been saved (wp_parse_args on a missing key). We must NOT | |
| 91 | - // coerce an explicitly-stored blank back to the default here: that would show | |
| 92 | - // the default in the editor while the frontend correctly renders blank — an | |
| 93 | - // inconsistent, unrepresentable "blank" state. Editor and frontend read the | |
| 94 | - // same stored value, so they stay in sync. | |
| 95 | 89 | $settings = Offline_Helper::get_all_offline_settings(); |
| 96 | 90 | |
| 97 | 91 | return new WP_REST_Response( |
| 98 | 92 | [ |
| @@ -112,12 +106,9 @@ | ||
| 112 | 106 | */ |
| 113 | 107 | public function update_settings( $request ) { |
| 114 | 108 | $params = $request->get_json_params(); |
| 115 | 109 | |
| 116 | - // Use the raw stored settings as the write baseline — not the coerced | |
| 117 | - // read (get_all_offline_settings), which would otherwise materialize the | |
| 118 | - // locale-frozen default into the DB when only the enable toggle changes. | |
| 119 | - $settings = Payment_Helper::get_gateway_settings( 'offline' ); | |
| 110 | + $settings = Offline_Helper::get_all_offline_settings(); | |
| 120 | 111 | |
| 121 | 112 | if ( isset( $params['enabled'] ) ) { |
| 122 | 113 | $settings['enabled'] = rest_sanitize_boolean( (bool) $params['enabled'] ); |
| 123 | 114 | } |