The register_setting function doesn't exist in Network Admin area
|Reported by:||cgrymala||Owned by:|
In the 3.0.x branch of WordPress, plugin authors could use the register_setting() function to whitelist either individual site options (the 'options' table) or network options (the 'sitemeta' table). If a network option was registered using the register_setting() function, calling add_site_option() or update_site_option() would invoke the sanitization callback included in the register_setting() function.
However, in the current trunk version of WordPress 3.1, the register_setting() function is not instantiated when working within the Network Admin area. In my case, I've chosen to use add_filter( 'sanitize_option_' . $plugin_name, 'plugin_sanitize_callback' ); instead.
I'm not sure if this is intended behavior or not. If the register_setting() function is supposed to be available when working on settings within the Network Admin area, hopefully it will be easy to fix. If that function is not supposed to be available, please feel free to ignore this ticket.
Either way, the codex entries for the various functions probably should be updated to include definitive information about whether the sanitize callback will be invoked automatically for Network options or not.
Change History (5)
- Resolution set to invalid
- Status changed from new to closed