[wp-trac] [WordPress Trac] #16577: The register_setting function doesn't exist in Network Admin area

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 17 02:21:27 UTC 2011


#16577: The register_setting function doesn't exist in Network Admin area
--------------------------+-------------------------------------
 Reporter:  cgrymala      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:  3.1
 Severity:  normal        |   Keywords:  needs-codex 2nd-opinion
--------------------------+-------------------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16577>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list