[wp-trac] [WordPress Trac] #35698: Distinguish between regular (site) options and network options in `sanitize_option()`
WordPress Trac
noreply at wordpress.org
Tue Feb 2 20:48:40 UTC 2016
#35698: Distinguish between regular (site) options and network options in
`sanitize_option()`
-------------------------+-----------------------------
Reporter: flixos90 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version:
Severity: normal | Keywords:
Focuses: multisite |
-------------------------+-----------------------------
Currently the filter in `sanitize_option()` runs for both "regular" site
options and network options as well. I think the kind of option being
sanitized should be distinguished since an option with the same slug might
have a completely different meaning in the context of a site vs a network.
I'm proposing to add a new filter `sanitize_network_option_{$option}`
which only runs when the option being sanitized is a network option. A new
(internal) parameter could be added to the function itself to tell the
function what kind of option is sanitized.
Besides fixing possible problems with site and network options of the same
name, this might also open up for an implementation of #15691 (as in
`register_network_setting()` or something similar).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35698>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list