[wp-trac] [WordPress Trac] #29193: Settings sanitize callback - $option arg is not available

WordPress Trac noreply at wordpress.org
Tue Aug 12 13:12:44 UTC 2014


#29193: Settings sanitize callback - $option arg is not available
-------------------------+-----------------------------
 Reporter:  dashaluna    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 If you register a setting and specify a sanitize callback, the option name
 argument is not available in the callback function.

 See wp-includes/formatting.php line 3432 - where WordPress applys the
 santiization filters.

     $value = apply_filters( "sanitize_option_{$option}", $value, $option
 );

 It passes as second arg of $option, but when registering as setting - the
 sanitization callback is added to this filter, but the number of accepted
 args is not specified when adding the filter.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29193>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list