Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #34893, comment 6


Ignore:
Timestamp:
12/08/2015 06:38:16 PM (9 years ago)
Author:
westonruter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34893, comment 6

    initial v1  
    44What about if the original raw unsanitized value is passed into the validator along with the sanitized value? This would allow the validator to have the flexibility to determine whether or not the sanitized value can be considered “good enough” for persisting to the DB, or else it can do a strict check to fail it simply if `$sanitized_value !== $unsanitized_value`.
    55
    6 In that regard, the patch for this ticket could be modified to pass in both the `$unsanitized_value` and the `$unsanitized_value` to the `customize_validate_{$setting_id}` filter. I've amended my patch to implement that: [attachment:34893.1.diff]. It also adds:
     6In that regard, the patch for this ticket could be modified to pass in both the `$sanitized_value` and the `$unsanitized_value` to the `customize_validate_{$setting_id}` filter. I've amended my patch to implement that: [attachment:34893.1.diff]. It also adds:
    77
    88* Adds a `$strict` second parameter to `WP_Customize_Setting::save()`, which is a signal that `WP_Error` can be returned