Opened 13 years ago
Closed 13 years ago
#19809 closed defect (bug) (invalid)
can't pass an array(class, method) as a callback in add_settings_field()
Reported by: | mati1000 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.3.1 |
Component: | General | Keywords: | close |
Focuses: | Cc: |
Description
I want to pass an array(class, method) as a callback for a settings field:
add_settings_field($field, $label, array(&$this, $method) , $slug, $section, $field);
But 'do_settings_sections' don't do a check like 'add_filter()' and it's used as string with 'call_user_func' in wp-admin/includes/template.php:1103
Change History (5)
Note: See
TracTickets for help on using
tickets.
The PHP error is:
Warning: call_user_func() [function.call-user-func]: First argument is expected to be a valid callback in /wp-admin/includes/template.php on line 1102