[wp-trac] [WordPress Trac] #35379: update_network_option changes stored option value if sanitize_option detects error
WordPress Trac
noreply at wordpress.org
Thu May 5 20:52:58 UTC 2016
#35379: update_network_option changes stored option value if sanitize_option
detects error
-------------------------------------------------+-------------------------
Reporter: thomaswm | Owner: jeremyfelt
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.6
Component: Options, Meta APIs | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs- | Focuses: multisite
testing |
-------------------------------------------------+-------------------------
Comment (by flixos90):
Replying to [comment:17 jeremyfelt]:
> I gave another read through `sanitize_option()` and still find myself
falling in favor of a new `sanitize_network_option()`. We would still need
to add the old filter, but we could drop all of the site specific option
switching and just focus on the network. This would also eliminate the
need to pass both `$context` and `$context_id`.
>
> Thoughts?
I'd prefer to use one function for this cause. Especially with a look at
#15691, a Settings API for the network admin should work in a similar
manner like the regular one. There is too much parity between site vs
network options to create separate functions. I don't see the point in
writing an additional function for so little change in functionality. I
think we should generally go with an additional `$context` (and when
needed `$context_id`) parameter to support existing functionality for
networks.
What we could of course do is create a `sanitize_network_option()`
function which would call the other function, automatically passing the
`network` context. It would make it a little more intuitive to use, but
not sure if this is needed either.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35379#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list