#20804 closed defect (bug) (duplicate)
sanitize_option_* filter does not specify number of arguments
| Reported by: | chokladzingo | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 3.4 |
| Severity: | trivial | Keywords: | has-patch |
| Cc: | Focuses: |
Description
register_setting() in wp-admin/includes/plugin.php adds a filter for each option registered. When this filter is later run by the sanitize_option() function the variables $value and $option are specified as arguments for the callback function. Since number of arguments ($accepted_args) was not specified when adding the filter in register_setting(), the $option argument is not supplied to the callback function.
This is simply fixed by supplying the $accepted_args argument to add_filter() in register_setting() and remove_filter() in unregister_setting().
Attachments (1)
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
For some context: supplying the $option value to callback functions is desirable since it will allow plugin developers to use a single sanitize function for all of the settings, instead of a single function for each setting.