Opened 10 years ago
Closed 10 years ago
#29193 closed enhancement (duplicate)
Settings sanitize callback - $option arg is not available
Reported by: | dashaluna | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.0 |
Component: | Options, Meta APIs | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
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.
Attachments (1)
Note: See
TracTickets for help on using
tickets.
It turns out that this has been removed intentionally to maintain backwards compatability - see https://core.trac.wordpress.org/ticket/18914