[wp-trac] [WordPress Trac] #15335: register_setting() filter for sanitization callback needs to indicate 2 arguments accepted

WordPress Trac noreply at wordpress.org
Wed Jul 4 16:22:11 UTC 2018


#15335: register_setting() filter for sanitization callback needs to indicate 2
arguments accepted
--------------------------------+-----------------------------
 Reporter:  lumination          |       Owner:  markjaquith
     Type:  defect (bug)        |      Status:  reopened
 Priority:  normal              |   Milestone:  Future Release
Component:  Options, Meta APIs  |     Version:  3.1
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  administration
--------------------------------+-----------------------------

Comment (by jlambe):

 I was going to report this as well and I found this original issue on
 trac.

 Just to go against the title issue, I suggest that the call to the
 `add_filter( "sanitize_option_{$option_name}",
 $args['sanitize_callback']);` (options.php - Line 2026 - WordPress 4.9.6)
 does define the 3 arguments provided by the `apply_filters(
 "sanitize_option_{$option}", $value, $option, $original_value );`
 (formatting.php - Line 4314 - WordPress 4.9.6).

 Indeed it is quite useful to get the setting name and it would make the
 code cleaner I suppose for some sanitization and validation on the server
 side.

 +1 to finally get this one merged on next release please :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/15335#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list