| @@ -307,8 +307,15 @@ | ||
| 307 | 307 | ); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | foreach ( $data as $key => $value ) { |
| 311 | + if ( false === $value ) { | |
| 312 | + // update_option() short-circuits when storing `false` over a | |
| 313 | + // missing option (both compare equal), so a default-enabled | |
| 314 | + // checkbox could never be persisted as disabled. | |
| 315 | + $value = ''; | |
| 316 | + } | |
| 317 | + | |
| 311 | 318 | update_option( 'wbcr_inp_' . $key, $value ); |
| 312 | 319 | } |
| 313 | 320 | |
| 314 | 321 | return new \WP_REST_Response( |